Changeset 365f259 in mainline
- Timestamp:
- 2013-03-03T17:14:26Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 90c1d80
- Parents:
- 80d5307
- Location:
- uspace/drv/audio/sb16
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/dsp.c
r80d5307 r365f259 40 40 #include <libarch/ddi.h> 41 41 #include <libarch/barrier.h> 42 #include <macros.h> 42 43 #include <str_error.h> 43 44 #include <audio_pcm_iface.h> … … 74 75 [DSP_NO_BUFFER] = "NO BUFFER", 75 76 }; 76 if (state < (sizeof(state_names) / sizeof(state_names[0])))77 if (state < ARRAY_SIZE(state_names)) 77 78 return state_names[state]; 78 79 return "UNKNOWN"; -
uspace/drv/audio/sb16/mixer.c
r80d5307 r365f259 31 31 #include <errno.h> 32 32 #include <libarch/ddi.h> 33 #include <macros.h> 33 34 #include <unistd.h> 34 35 … … 128 129 129 130 static const struct { 131 const volume_item_t *table; 130 132 size_t count; 131 const volume_item_t *table;132 133 } volume_table[] = { 133 [SB_MIXER_NONE] = { 0, NULL }, 134 [SB_MIXER_UNKNOWN] = { 0, NULL }, 135 [SB_MIXER_CT1335] = { 136 sizeof(volume_ct1335) / sizeof(volume_item_t), volume_ct1335 }, 137 [SB_MIXER_CT1345] = { 138 sizeof(volume_ct1345) / sizeof(volume_item_t), volume_ct1345 }, 139 [SB_MIXER_CT1745] = { 140 sizeof(volume_ct1745) / sizeof(volume_item_t), volume_ct1745 }, 134 [SB_MIXER_NONE] = { NULL, 0 }, 135 [SB_MIXER_UNKNOWN] = { NULL, 0 }, 136 [SB_MIXER_CT1335] = { volume_ct1335, ARRAY_SIZE(volume_ct1335) }, 137 [SB_MIXER_CT1345] = { volume_ct1345, ARRAY_SIZE(volume_ct1345) }, 138 [SB_MIXER_CT1745] = { volume_ct1745, ARRAY_SIZE(volume_ct1745) }, 141 139 }; 142 140 143 141 const char * sb_mixer_type_str(sb_mixer_type_t type) 144 142 { 145 static const char * names[] = { 143 static const char *names[] = { 144 [SB_MIXER_NONE] = "No mixer", 146 145 [SB_MIXER_CT1335] = "CT 1335", 147 146 [SB_MIXER_CT1345] = "CT 1345", -
uspace/drv/audio/sb16/sb16.c
r80d5307 r365f259 31 31 #include <errno.h> 32 32 #include <str_error.h> 33 #include <macros.h> 33 34 #include <audio_mixer_iface.h> 34 35 #include <audio_pcm_iface.h> … … 73 74 size_t sb16_irq_code_size(void) 74 75 { 75 return sizeof(irq_cmds) / sizeof(irq_cmds[0]);76 return ARRAY_SIZE(irq_cmds); 76 77 } 77 78
Note:
See TracChangeset
for help on using the changeset viewer.