From: Mauro Carvalho Chehab Date: Sun, 29 May 2011 13:54:09 +0000 (-0300) Subject: get_media_devices: Constify arguments X-Git-Tag: v4l-utils-0.8.4~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d107fbd7cbb8fdadea7cbc4963016fc82230e2dd;p=platform%2Fupstream%2Fv4l-utils.git get_media_devices: Constify arguments Signed-off-by: Mauro Carvalho Chehab --- diff --git a/utils/libmedia_dev/get_media_devices.c b/utils/libmedia_dev/get_media_devices.c index 89164ac..c27d7f5 100644 --- a/utils/libmedia_dev/get_media_devices.c +++ b/utils/libmedia_dev/get_media_devices.c @@ -327,7 +327,7 @@ error: return NULL; } -char *media_device_type(enum device_type type) +const char *media_device_type(enum device_type type) { switch(type) { /* V4L nodes */ @@ -395,11 +395,11 @@ void display_media_devices(void *opaque) printf("\n"); } -char *get_associated_device(void *opaque, - char *last_seek, - enum device_type desired_type, - char *seek_device, - enum device_type seek_type) +const char *get_associated_device(void *opaque, + const char *last_seek, + const enum device_type desired_type, + const char *seek_device, + const enum device_type seek_type) { struct media_devices *md = opaque; struct media_device_entry *md_ptr = md->md_entry; @@ -458,11 +458,11 @@ char *get_associated_device(void *opaque, return NULL; } -char *fget_associated_device(void *opaque, - char *last_seek, - enum device_type desired_type, - int fd_seek_device, - enum device_type seek_type) +const char *fget_associated_device(void *opaque, + const char *last_seek, + const enum device_type desired_type, + const int fd_seek_device, + const enum device_type seek_type) { struct media_devices *md = opaque; struct media_device_entry *md_ptr = md->md_entry; @@ -518,10 +518,10 @@ char *fget_associated_device(void *opaque, return NULL; } -char *get_not_associated_device(void *opaque, - char *last_seek, - enum device_type desired_type, - enum device_type not_desired_type) +const char *get_not_associated_device(void *opaque, + const char *last_seek, + const enum device_type desired_type, + const enum device_type not_desired_type) { struct media_devices *md = opaque; struct media_device_entry *md_ptr = md->md_entry; diff --git a/utils/libmedia_dev/get_media_devices.h b/utils/libmedia_dev/get_media_devices.h index f005a54..6ff1d59 100644 --- a/utils/libmedia_dev/get_media_devices.h +++ b/utils/libmedia_dev/get_media_devices.h @@ -20,7 +20,7 @@ /* * Version of the API */ -#define GET_MEDIA_DEVICES_VERSION 0x0104 +#define GET_MEDIA_DEVICES_VERSION 0x0105 /** * enum device_type - Enumerates the type for each device @@ -87,7 +87,7 @@ void free_media_devices(void *opaque); * * @type: media device type */ -char *media_device_type(enum device_type type); +const char *media_device_type(const enum device_type type); /** * display_media_devices() - prints a list of media devices @@ -112,11 +112,11 @@ void display_media_devices(void *opaque); * the seek_device is NULL or seek_type is NONE, it will just search for * devices of the desired_type. */ -char *get_associated_device(void *opaque, - char *last_seek, - enum device_type desired_type, - char *seek_device, - enum device_type seek_type); +const char *get_associated_device(void *opaque, + const char *last_seek, + const enum device_type desired_type, + const char *seek_device, + const enum device_type seek_type); /** * fget_associated_device() - Return the next device associated with another one @@ -133,11 +133,11 @@ char *get_associated_device(void *opaque, * that it is associated with a seek parameter. * It can be used to get an alsa device associated with an open file descriptor */ -char *fget_associated_device(void *opaque, - char *last_seek, - enum device_type desired_type, - int fd_seek_device, - enum device_type seek_type); +const char *fget_associated_device(void *opaque, + const char *last_seek, + const enum device_type desired_type, + const int fd_seek_device, + const enum device_type seek_type); /** * get_not_associated_device() - Return the next device not associated with @@ -153,7 +153,7 @@ char *fget_associated_device(void *opaque, * This method is useful for example to return the audio devices that are * provided by the motherboard. */ -char *get_not_associated_device(void *opaque, - char *last_seek, - enum device_type desired_type, - enum device_type not_desired_type); +const char *get_not_associated_device(void *opaque, + const char *last_seek, + const enum device_type desired_type, + const enum device_type not_desired_type); diff --git a/utils/v4l2-sysfs-path/v4l2-sysfs-path.c b/utils/v4l2-sysfs-path/v4l2-sysfs-path.c index 7579612..d204ad2 100644 --- a/utils/v4l2-sysfs-path/v4l2-sysfs-path.c +++ b/utils/v4l2-sysfs-path/v4l2-sysfs-path.c @@ -27,10 +27,10 @@ #include "../libmedia_dev/get_media_devices.h" #include -static void print_all_associated_devices(void *md, char *vid, - enum device_type type) +static void print_all_associated_devices(void *md, const char *vid, + const enum device_type type) { - char *devname = NULL; + const char *devname = NULL; int first = 1; do { @@ -51,7 +51,7 @@ static void print_all_associated_devices(void *md, char *vid, static void print_all_alsa_independent_playback(void *md) { - char *devname = NULL; + const char *devname = NULL; int first = 1; do { @@ -73,7 +73,7 @@ static void print_all_alsa_independent_playback(void *md) int main(void) { void *md; - char *vid; + const char *vid; int i; md = discover_media_devices();