Ignore:
Timestamp:
2013-04-10T21:41:10Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
876f5561
Parents:
5b77efc
Message:

libdrv: few more comments

use ARRAY_SIZE macro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_audio_pcm.c

    r5b77efc reb0ef51  
    3636#include <ddf/log.h>
    3737#include <errno.h>
     38#include <macros.h>
    3839#include <str.h>
    3940#include <as.h>
     
    5859} audio_pcm_iface_funcs_t;
    5960
     61/**
     62 * Get human readable capability name.
     63 * @param cap audio capability.
     64 * @return Valid string
     65 */
    6066const char *audio_pcm_cap_str(audio_cap_t cap)
    6167{
     
    6975                [AUDIO_CAP_INTERRUPT_MAX_FRAMES] = "MAXIMUM FRAGMENT SIZE",
    7076        };
    71         if (cap > (sizeof(caps) / sizeof(*caps)))
     77        if (cap >= ARRAY_SIZE(caps))
    7278                return "UNKNOWN CAP";
    7379        return caps[cap];
     
    7581}
    7682
     83/**
     84 * Get human readable event name.
     85 * @param event Audio device event
     86 * @return Valid string
     87 */
    7788const char *audio_pcm_event_str(pcm_event_t event)
    7889{
     
    8596                [PCM_EVENT_CAPTURE_TERMINATED] = "CAPTURE TERMINATED",
    8697        };
    87         if (event > (sizeof(events) / sizeof(*events)))
     98        if (event >= ARRAY_SIZE(events))
    8899                return "UNKNOWN EVENT";
    89100        return events[event];
     
    123134        return session;
    124135}
     136
    125137/**
    126138 * Open audio session with device identified by location service string.
Note: See TracChangeset for help on using the changeset viewer.