Changeset eb0ef51 in mainline for uspace/lib/drv/generic/remote_audio_pcm.c
- Timestamp:
- 2013-04-10T21:41:10Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 876f5561
- Parents:
- 5b77efc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_audio_pcm.c
r5b77efc reb0ef51 36 36 #include <ddf/log.h> 37 37 #include <errno.h> 38 #include <macros.h> 38 39 #include <str.h> 39 40 #include <as.h> … … 58 59 } audio_pcm_iface_funcs_t; 59 60 61 /** 62 * Get human readable capability name. 63 * @param cap audio capability. 64 * @return Valid string 65 */ 60 66 const char *audio_pcm_cap_str(audio_cap_t cap) 61 67 { … … 69 75 [AUDIO_CAP_INTERRUPT_MAX_FRAMES] = "MAXIMUM FRAGMENT SIZE", 70 76 }; 71 if (cap > (sizeof(caps) / sizeof(*caps)))77 if (cap >= ARRAY_SIZE(caps)) 72 78 return "UNKNOWN CAP"; 73 79 return caps[cap]; … … 75 81 } 76 82 83 /** 84 * Get human readable event name. 85 * @param event Audio device event 86 * @return Valid string 87 */ 77 88 const char *audio_pcm_event_str(pcm_event_t event) 78 89 { … … 85 96 [PCM_EVENT_CAPTURE_TERMINATED] = "CAPTURE TERMINATED", 86 97 }; 87 if (event > (sizeof(events) / sizeof(*events)))98 if (event >= ARRAY_SIZE(events)) 88 99 return "UNKNOWN EVENT"; 89 100 return events[event]; … … 123 134 return session; 124 135 } 136 125 137 /** 126 138 * Open audio session with device identified by location service string.
Note:
See TracChangeset
for help on using the changeset viewer.