Changes in uspace/lib/cpp/src/string.cpp [bc56f30:7dcce0a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/src/string.cpp
rbc56f30 r7dcce0a 42 42 { 43 43 char* end; 44 long result = ::strtol(str.c_str(), &end, base);44 long result = hel::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 = ::strtoul(str.c_str(), &end, base);60 unsigned long result = hel::strtoul(str.c_str(), &end, base); 61 61 62 62 if (end != str.c_str()) … … 106 106 } 107 107 108 namespace hel 109 { 110 extern "C" int asprintf(char**, const char*, ...); 111 } 112 108 113 string to_string(int val) 109 114 { 110 115 char* tmp; 111 ::asprintf(&tmp, "%d", val);116 hel::asprintf(&tmp, "%d", val); 112 117 113 118 std::string res{tmp}; … … 120 125 { 121 126 char* tmp; 122 ::asprintf(&tmp, "%u", val);127 hel::asprintf(&tmp, "%u", val); 123 128 124 129 std::string res{tmp}; … … 131 136 { 132 137 char* tmp; 133 ::asprintf(&tmp, "%ld", val);138 hel::asprintf(&tmp, "%ld", val); 134 139 135 140 std::string res{tmp}; … … 142 147 { 143 148 char* tmp; 144 ::asprintf(&tmp, "%lu", val);149 hel::asprintf(&tmp, "%lu", val); 145 150 146 151 std::string res{tmp}; … … 153 158 { 154 159 char* tmp; 155 ::asprintf(&tmp, "%lld", val);160 hel::asprintf(&tmp, "%lld", val); 156 161 157 162 std::string res{tmp}; … … 164 169 { 165 170 char* tmp; 166 ::asprintf(&tmp, "%llu", val);171 hel::asprintf(&tmp, "%llu", val); 167 172 168 173 std::string res{tmp}; … … 175 180 { 176 181 char* tmp; 177 ::asprintf(&tmp, "%f", val);182 hel::asprintf(&tmp, "%f", val); 178 183 179 184 std::string res{tmp}; … … 186 191 { 187 192 char* tmp; 188 ::asprintf(&tmp, "%f", val);193 hel::asprintf(&tmp, "%f", val); 189 194 190 195 std::string res{tmp}; … … 197 202 { 198 203 char* tmp; 199 ::asprintf(&tmp, "%Lf", val);204 hel::asprintf(&tmp, "%Lf", val); 200 205 201 206 std::string res{tmp};
Note:
See TracChangeset
for help on using the changeset viewer.