diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2014-04-11 20:19:32 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2014-04-11 20:19:32 +0000 |
commit | 669d3bfc2fc7b1b8f8fbe4e97e1b51a37068b3ed (patch) | |
tree | 0a10419c81ce373256950ed05ad1298e6211289b /camlibs/spca50x | |
parent | 292d2f69aa9846a2d24dafb0263828e8806f34c7 (diff) | |
download | libgphoto2-669d3bfc2fc7b1b8f8fbe4e97e1b51a37068b3ed.tar.gz |
From: "Daniel P. Berrange" <dan@berrange.com>
Many callers of strcpy/scanf/strcmp functions are passing a
'unsigned char *' rather than the 'char *' they expect.
Add explicit casts to silence the compiler.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14901 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/spca50x')
-rw-r--r-- | camlibs/spca50x/spca50x-flash.c | 2 | ||||
-rw-r--r-- | camlibs/spca50x/spca50x-sdram.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/camlibs/spca50x/spca50x-flash.c b/camlibs/spca50x/spca50x-flash.c index 7ad815a2b..2d32f6b0b 100644 --- a/camlibs/spca50x/spca50x-flash.c +++ b/camlibs/spca50x/spca50x-flash.c @@ -563,7 +563,7 @@ spca50x_process_thumbnail (CameraPrivateLibrary *lib, /* context */ * This should never fail; it would be nice to have an error * code like GP_ERROR_CAMLIB_INTERNAL for cases like this. */ - hdrlen = snprintf(tmp, alloc_size, "P6 %d %d 255\n", w, h); + hdrlen = snprintf((char*)tmp, alloc_size, "P6 %d %d 255\n", w, h); true_size = w * h * 3 + hdrlen; if ( true_size > alloc_size ) { free (tmp); diff --git a/camlibs/spca50x/spca50x-sdram.c b/camlibs/spca50x/spca50x-sdram.c index f62c22bc5..c7472a786 100644 --- a/camlibs/spca50x/spca50x-sdram.c +++ b/camlibs/spca50x/spca50x-sdram.c @@ -642,7 +642,7 @@ spca50x_get_image_thumbnail (CameraPrivateLibrary * lib, uint8_t ** buf, } tmp = *buf; - snprintf (tmp, *len, "P6 %d %d 255\n", t_width, t_height); + snprintf ((char*)tmp, *len, "P6 %d %d 255\n", t_width, t_height); tmp += headerlength; yuv_p = mybuf; @@ -891,13 +891,13 @@ spca50x_get_FATs (CameraPrivateLibrary * lib, int dramtype) } else { /* its an image */ if (type == 0x00 || type == 0x01) { - snprintf (buf, 13, "Image%03d.jpg", + snprintf ((char*)buf, 13, "Image%03d.jpg", ++lib->num_images); lib->files[file_index].mime_type = SPCA50X_FILE_TYPE_IMAGE; } else if ((type == 0x08) || (type == 0x03)) { /* its the start of an avi */ - snprintf (buf, 13, "Movie%03d.avi", + snprintf ((char*)buf, 13, "Movie%03d.avi", ++lib->num_movies); lib->files[file_index].mime_type = SPCA50X_FILE_TYPE_AVI; @@ -905,7 +905,7 @@ spca50x_get_FATs (CameraPrivateLibrary * lib, int dramtype) lib->files[file_index].fat = p; lib->files[file_index].fat_start = index; lib->files[file_index].fat_end = index; - lib->files[file_index].name = strdup (buf); + lib->files[file_index].name = strdup ((char*)buf); if (lib->bridge == BRIDGE_SPCA504) { lib->files[file_index].width = (p[8] & 0xFF) * 16; |