Changeset bc56f30 in mainline for uspace/lib/cpp/src
- Timestamp:
- 2019-05-27T12:38:26Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0d14c25
- Parents:
- 4d51c60
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-13 16:06:49)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-05-27 12:38:26)
- Location:
- uspace/lib/cpp/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/src/stdexcept.cpp
r4d51c60 rbc56f30 31 31 #include <stdexcept> 32 32 #include <string> 33 #include <str.h> 33 34 34 35 namespace std 35 36 { 36 37 logic_error::logic_error(const string& what) 37 : what_{ hel::str_dup(what.c_str())}38 : what_{::helenos::str_dup(what.c_str())} 38 39 { /* DUMMY BODY */ } 39 40 40 41 logic_error::logic_error(const char* what) 41 : what_{ hel::str_dup(what)}42 : what_{::helenos::str_dup(what)} 42 43 { /* DUMMY BODY */ } 43 44 44 45 logic_error::logic_error(const logic_error& other) noexcept 45 : exception{other}, what_{ hel::str_dup(other.what_)}46 : exception{other}, what_{::helenos::str_dup(other.what_)} 46 47 { /* DUMMY BODY */ } 47 48 … … 50 51 if (what_) 51 52 free(what_); 52 what_ = hel::str_dup(other.what_);53 what_ = ::helenos::str_dup(other.what_); 53 54 54 55 return *this; … … 114 115 115 116 runtime_error::runtime_error(const string& what) 116 : what_{ hel::str_dup(what.c_str())}117 : what_{::helenos::str_dup(what.c_str())} 117 118 { /* DUMMY BODY */ } 118 119 119 120 runtime_error::runtime_error(const char* what) 120 : what_{ hel::str_dup(what)}121 : what_{::helenos::str_dup(what)} 121 122 { /* DUMMY BODY */ } 122 123 123 124 runtime_error::runtime_error(const runtime_error& other) noexcept 124 : exception{other}, what_{ hel::str_dup(other.what_)}125 : exception{other}, what_{::helenos::str_dup(other.what_)} 125 126 { /* DUMMY BODY */ } 126 127 … … 129 130 if (what_) 130 131 free(what_); 131 what_ = hel::str_dup(other.what_);132 what_ = ::helenos::str_dup(other.what_); 132 133 133 134 return *this; -
uspace/lib/cpp/src/string.cpp
r4d51c60 rbc56f30 42 42 { 43 43 char* end; 44 long result = hel::strtol(str.c_str(), &end, base);44 long result = ::strtol(str.c_str(), &end, base); 45 45 46 46 if (end != str.c_str()) … … 58 58 { 59 59 char* end; 60 unsigned long result = hel::strtoul(str.c_str(), &end, base);60 unsigned long result = ::strtoul(str.c_str(), &end, base); 61 61 62 62 if (end != str.c_str()) … … 106 106 } 107 107 108 namespace hel109 {110 extern "C" int asprintf(char**, const char*, ...);111 }112 113 108 string to_string(int val) 114 109 { 115 110 char* tmp; 116 hel::asprintf(&tmp, "%d", val);111 ::asprintf(&tmp, "%d", val); 117 112 118 113 std::string res{tmp}; … … 125 120 { 126 121 char* tmp; 127 hel::asprintf(&tmp, "%u", val);122 ::asprintf(&tmp, "%u", val); 128 123 129 124 std::string res{tmp}; … … 136 131 { 137 132 char* tmp; 138 hel::asprintf(&tmp, "%ld", val);133 ::asprintf(&tmp, "%ld", val); 139 134 140 135 std::string res{tmp}; … … 147 142 { 148 143 char* tmp; 149 hel::asprintf(&tmp, "%lu", val);144 ::asprintf(&tmp, "%lu", val); 150 145 151 146 std::string res{tmp}; … … 158 153 { 159 154 char* tmp; 160 hel::asprintf(&tmp, "%lld", val);155 ::asprintf(&tmp, "%lld", val); 161 156 162 157 std::string res{tmp}; … … 169 164 { 170 165 char* tmp; 171 hel::asprintf(&tmp, "%llu", val);166 ::asprintf(&tmp, "%llu", val); 172 167 173 168 std::string res{tmp}; … … 180 175 { 181 176 char* tmp; 182 hel::asprintf(&tmp, "%f", val);177 ::asprintf(&tmp, "%f", val); 183 178 184 179 std::string res{tmp}; … … 191 186 { 192 187 char* tmp; 193 hel::asprintf(&tmp, "%f", val);188 ::asprintf(&tmp, "%f", val); 194 189 195 190 std::string res{tmp}; … … 202 197 { 203 198 char* tmp; 204 hel::asprintf(&tmp, "%Lf", val);199 ::asprintf(&tmp, "%Lf", val); 205 200 206 201 std::string res{tmp}; -
uspace/lib/cpp/src/typeinfo.cpp
r4d51c60 rbc56f30 38 38 bool type_info::operator==(const type_info& other) const noexcept 39 39 { 40 return (this == &other) || 41 std::hel::str_cmp(name(), other.name()); 40 return (this == &other) || ::strcmp(name(), other.name()) == 0; 42 41 } 43 42
Note:
See TracChangeset
for help on using the changeset viewer.