Changeset 7d7bc09 in mainline for uspace/lib/c/generic
- Timestamp:
- 2018-06-20T18:58:11Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 777832e
- Parents:
- 3bd1d7d4
- Location:
- uspace/lib/c/generic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/printf_core.c
r3bd1d7d4 r7d7bc09 39 39 #include <stdio.h> 40 40 #include <stddef.h> 41 #include <stdlib.h> 41 42 #include <io/printf_core.h> 42 43 #include <ctype.h> -
uspace/lib/c/generic/stdlib.c
r3bd1d7d4 r7d7bc09 195 195 } 196 196 197 /** Compute the absolute value of an integer. 198 * 199 * If the result cannot be represented, the behavior is undefined. 200 * 201 * @param j Integer 202 * @return The absolute value of @a j 203 */ 204 int abs(int j) 205 { 206 int aj; 207 208 if (j < 0) { 209 aj = -j; 210 assert(aj >= 0); 211 } else { 212 aj = j; 213 } 214 215 return aj; 216 } 217 218 /** Compute the absolute value of a long integer. 219 * 220 * If the result cannot be represented, the behavior is undefined. 221 * 222 * @param j Long integer 223 * @return The absolute value of @a j 224 */ 225 long labs(long j) 226 { 227 long aj; 228 229 if (j < 0) { 230 aj = -j; 231 assert(aj >= 0); 232 } else { 233 aj = j; 234 } 235 236 return aj; 237 } 238 239 /** Compute the absolute value of a long long integer. 240 * 241 * If the result cannot be represented, the behavior is undefined. 242 * 243 * @param j Long long integer 244 * @return The absolute value of @a j 245 */ 246 long long llabs(long long j) 247 { 248 long long aj; 249 250 if (j < 0) { 251 aj = -j; 252 assert(aj >= 0); 253 } else { 254 aj = j; 255 } 256 257 return aj; 258 } 259 197 260 /** Compute quotient and remainder of int division. 198 261 * -
uspace/lib/c/generic/vfs/vfs.c
r3bd1d7d4 r7d7bc09 285 285 { 286 286 size_t abs_size; 287 char *abs = vfs_absolutize(path, &abs_size);288 if ( !abs)287 char *abs_path = vfs_absolutize(path, &abs_size); 288 if (abs_path == NULL) 289 289 return ENOMEM; 290 290 291 291 int fd; 292 errno_t rc = vfs_lookup(abs , WALK_DIRECTORY, &fd);292 errno_t rc = vfs_lookup(abs_path, WALK_DIRECTORY, &fd); 293 293 if (rc != EOK) { 294 free(abs );294 free(abs_path); 295 295 return rc; 296 296 } … … 305 305 306 306 cwd_fd = fd; 307 cwd_path = abs ;307 cwd_path = abs_path; 308 308 cwd_size = abs_size; 309 309
Note:
See TracChangeset
for help on using the changeset viewer.
