Changeset 52f9c57 in mainline
- Timestamp:
- 2012-12-22T22:39:19Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a6a9910
- Parents:
- 6326155b
- Location:
- uspace/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/macros.h
r6326155b r52f9c57 40 40 #define abs(a) ((a) >= 0 ? (a) : (-a)) 41 41 42 #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) 42 43 43 44 #define KiB2SIZE(kb) ((kb) << 10) -
uspace/lib/usb/src/usb.c
r6326155b r52f9c57 38 38 #include <errno.h> 39 39 #include <assert.h> 40 41 #define ARR_SIZE(arr) (sizeof(arr)/sizeof(arr[0])) 40 #include <macros.h> 42 41 43 42 static const char *str_speed[] = { … … 74 73 const char *usb_str_transfer_type(usb_transfer_type_t t) 75 74 { 76 if (t >= ARR _SIZE(str_transfer_type)) {75 if (t >= ARRAY_SIZE(str_transfer_type)) { 77 76 return "invalid"; 78 77 } … … 87 86 const char *usb_str_transfer_type_short(usb_transfer_type_t t) 88 87 { 89 if (t >= ARR _SIZE(str_transfer_type_short)) {88 if (t >= ARRAY_SIZE(str_transfer_type_short)) { 90 89 return "invl"; 91 90 } … … 100 99 const char *usb_str_direction(usb_direction_t d) 101 100 { 102 if (d >= ARR _SIZE(str_direction)) {101 if (d >= ARRAY_SIZE(str_direction)) { 103 102 return "invalid"; 104 103 } … … 113 112 const char *usb_str_speed(usb_speed_t s) 114 113 { 115 if (s >= ARR _SIZE(str_speed)) {114 if (s >= ARRAY_SIZE(str_speed)) { 116 115 return "invalid"; 117 116 }
Note:
See TracChangeset
for help on using the changeset viewer.