summaryrefslogtreecommitdiff
path: root/camlibs
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2008-05-15 21:14:06 +0000
committerMarcus Meissner <marcus@jet.franken.de>2008-05-15 21:14:06 +0000
commitb1886bb096a798bbc22d91de9bd6fd972ef87c9b (patch)
treec2ab7fa8717805b12d8b00192fef71e1f856c90d /camlibs
parent723c0a8f2d186f71b771abfe12f1920730df4867 (diff)
downloadlibgphoto2-b1886bb096a798bbc22d91de9bd6fd972ef87c9b.tar.gz
u_char -> unsigned char
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@11141 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs')
-rw-r--r--camlibs/sonydscf1/ChangeLog4
-rw-r--r--camlibs/sonydscf1/command.c62
-rw-r--r--camlibs/sonydscf1/command.h6
-rw-r--r--camlibs/sonydscf1/sonydscf1.c24
4 files changed, 50 insertions, 46 deletions
diff --git a/camlibs/sonydscf1/ChangeLog b/camlibs/sonydscf1/ChangeLog
index f5ee0539e..d63a88349 100644
--- a/camlibs/sonydscf1/ChangeLog
+++ b/camlibs/sonydscf1/ChangeLog
@@ -1,3 +1,7 @@
+2008-05-15 Marcus Meissner <marcus@jet.franken.de>
+
+ * *.[ch]: u_char -> unsigned char
+
2007-11-16 Marcus Meissner <marcus@jet.franken.de>
* *.[ch]: Major cleanup, make it work.
diff --git a/camlibs/sonydscf1/command.c b/camlibs/sonydscf1/command.c
index dafdcc086..98f2c01e9 100644
--- a/camlibs/sonydscf1/command.c
+++ b/camlibs/sonydscf1/command.c
@@ -9,30 +9,30 @@
#include "command.h"
-static u_char address = 0;
-static const u_char sendaddr[8] = { 0x00, 0x22, 0x44, 0x66, 0x88, 0xaa, 0xcc, 0xee };
-static const u_char recvaddr[8] = { 0x0e, 0x20, 0x42, 0x64, 0x86, 0xa8, 0xca, 0xec };
+static unsigned char address = 0;
+static const unsigned char sendaddr[8] = { 0x00, 0x22, 0x44, 0x66, 0x88, 0xaa, 0xcc, 0xee };
+static const unsigned char recvaddr[8] = { 0x0e, 0x20, 0x42, 0x64, 0x86, 0xa8, 0xca, 0xec };
static int sw_mode = 0;
static int pic_num = 0;
static int pic_num2 = 0;
static int year, month, date;
static int hour, minutes;
-static const u_char BOFRAME = 0xC0;
-static const u_char EOFRAME = 0xC1;
+static const unsigned char BOFRAME = 0xC0;
+static const unsigned char EOFRAME = 0xC1;
#define CESCAPE 0x7D
static int F1reset(GPPort *port);
static int
-wbyte(GPPort *port,u_char c)
+wbyte(GPPort *port,unsigned char c)
{
- u_char temp = c;
+ unsigned char temp = c;
return gp_port_write(port, (char*)&temp, 1);
}
-static u_char
-checksum(u_char addr, u_char *cp, int len)
+static unsigned char
+checksum(unsigned char addr, unsigned char *cp, int len)
{
int ret = addr;
while(len --)
@@ -41,7 +41,7 @@ checksum(u_char addr, u_char *cp, int len)
}
static void
-sendcommand(GPPort *port,u_char *p, int len)
+sendcommand(GPPort *port,unsigned char *p, int len)
{
wbyte(port,BOFRAME);
wbyte(port,sendaddr[address]);
@@ -55,7 +55,7 @@ sendcommand(GPPort *port,u_char *p, int len)
static void
Abort(GPPort *port)
{
- u_char buf[4];
+ unsigned char buf[4];
buf[0] = BOFRAME;
buf[1] = 0x85;
buf[2] = 0x7B;
@@ -63,9 +63,9 @@ Abort(GPPort *port)
gp_port_write (port, (char*)buf, 4);
}
-static int recvdata(GPPort *port, u_char *p, int len)
+static int recvdata(GPPort *port, unsigned char *p, int len)
{
- u_char s, t;
+ unsigned char s, t;
int sum;
int i;
@@ -113,7 +113,7 @@ static int recvdata(GPPort *port, u_char *p, int len)
char F1newstatus(GPPort *port, int verbose, char *return_buf)
{
- u_char buf[34];
+ unsigned char buf[34];
int i;
char status_buf[1000]="";
char tmp_buf[150]="";
@@ -170,7 +170,7 @@ char F1newstatus(GPPort *port, int verbose, char *return_buf)
int F1status(GPPort *port)
{
- u_char buf[34];
+ unsigned char buf[34];
int i;
buf[0] = 0x03;
@@ -224,7 +224,7 @@ int F1howmany(GPPort *port)
int F1fopen(GPPort *port, char *name)
{
- u_char buf[64];
+ unsigned char buf[64];
int len;
buf[0] = 0x02;
buf[1] = 0x0A;
@@ -245,7 +245,7 @@ int F1fopen(GPPort *port, char *name)
int F1fclose(GPPort*port)
{
- u_char buf[4];
+ unsigned char buf[4];
buf[0] = 0x02;
buf[1] = 0x0B;
@@ -264,14 +264,14 @@ int F1fclose(GPPort*port)
return (buf[2]); /* ok == 0 */
}
-long F1fread(GPPort *port, u_char *data, long len)
+long F1fread(GPPort *port, unsigned char *data, long len)
{
long len2;
long i = 0;
- u_char s;
+ unsigned char s;
- u_char buf[10];
+ unsigned char buf[10];
buf[0] = 0x02;
buf[1] = 0x0C;
@@ -316,7 +316,7 @@ long F1fread(GPPort *port, u_char *data, long len)
long F1fseek(GPPort *port,long offset, int base)
{
- u_char buf[10];
+ unsigned char buf[10];
buf[0] = 0x02;
buf[1] = 0x0E;
@@ -341,13 +341,13 @@ long F1fseek(GPPort *port,long offset, int base)
return(buf[2]);
}
-long F1fwrite(GPPort *port,u_char *data, long len, u_char b) /* this function not work well */
+long F1fwrite(GPPort *port,unsigned char *data, long len, unsigned char b) /* this function not work well */
{
long i = 0;
- u_char *p;
- u_char s;
- u_char buf[10];
+ unsigned char *p;
+ unsigned char s;
+ unsigned char buf[10];
int checksum;
@@ -399,7 +399,7 @@ long F1fwrite(GPPort *port,u_char *data, long len, u_char b) /* this function no
u_long F1finfo(GPPort *port,char *name)
{
- u_char buf[64];
+ unsigned char buf[64];
int len;
u_long flen;
@@ -433,12 +433,12 @@ u_long F1finfo(GPPort *port,char *name)
return(flen);
}
-long F1getdata(GPPort*port,char *name, u_char *data)
+long F1getdata(GPPort*port,char *name, unsigned char *data)
{
long filelen;
long total = 0;
long len;
- u_char *p;
+ unsigned char *p;
F1status(port);
p = data;
@@ -463,7 +463,7 @@ long F1getdata(GPPort*port,char *name, u_char *data)
int F1deletepicture(GPPort *port,int n)
{
- u_char buf[4];
+ unsigned char buf[4];
gp_log (GP_LOG_DEBUG, "F1deletepicture", "Deleting picture %d...", n);
buf[0] = 0x02;
@@ -482,7 +482,7 @@ int F1deletepicture(GPPort *port,int n)
int F1ok(GPPort*port)
{
int retrycount = 100;
- u_char buf[64];
+ unsigned char buf[64];
gp_log (GP_LOG_DEBUG, "F1ok", "Asking for OK...");
@@ -509,7 +509,7 @@ int F1ok(GPPort*port)
static int
F1reset(GPPort *port)
{
- u_char buf[3];
+ unsigned char buf[3];
gp_log (GP_LOG_DEBUG, "F1reset", "Resetting camera...");
retryreset:
buf[0] = 0x01;
diff --git a/camlibs/sonydscf1/command.h b/camlibs/sonydscf1/command.h
index fe351f621..23687eb4a 100644
--- a/camlibs/sonydscf1/command.h
+++ b/camlibs/sonydscf1/command.h
@@ -2,13 +2,13 @@
#define __COMMAND_H__
int F1ok (GPPort*);
-long F1getdata (GPPort*,char *, u_char *);
+long F1getdata (GPPort*,char *, unsigned char *);
int F1status (GPPort*);
char F1newstatus (GPPort *port, int, char *);
int F1howmany (GPPort *);
int F1fopen (GPPort *,char *);
-long F1fread(GPPort *,u_char *data, long len);
-long F1fwrite(GPPort *,u_char *data, long len, u_char b);
+long F1fread(GPPort *,unsigned char *data, long len);
+long F1fwrite(GPPort *,unsigned char *data, long len, unsigned char b);
long F1fseek (GPPort *,long, int);
u_long F1finfo (GPPort *,char *);
int F1fclose (GPPort *);
diff --git a/camlibs/sonydscf1/sonydscf1.c b/camlibs/sonydscf1/sonydscf1.c
index 7325508a1..5cd7846ce 100644
--- a/camlibs/sonydscf1/sonydscf1.c
+++ b/camlibs/sonydscf1/sonydscf1.c
@@ -31,13 +31,13 @@
#define PMF_MAXSIZ 3*1024
#define MAX_PICTURE_NUM 200
-static u_char picture_index[MAX_PICTURE_NUM];
+static unsigned char picture_index[MAX_PICTURE_NUM];
static u_short picture_thumbnail_index[MAX_PICTURE_NUM];
-static u_char picture_protect[MAX_PICTURE_NUM];
-static u_char picture_rotate[MAX_PICTURE_NUM];
+static unsigned char picture_protect[MAX_PICTURE_NUM];
+static unsigned char picture_rotate[MAX_PICTURE_NUM];
static int
-make_jpeg_comment(u_char *buf, u_char *jpeg_comment)
+make_jpeg_comment(unsigned char *buf, unsigned char *jpeg_comment)
{
int i, cur = 0;
int reso, shutter;
@@ -137,8 +137,8 @@ make_jpeg_comment(u_char *buf, u_char *jpeg_comment)
}
/* insert total jpeg comment length */
- jpeg_comment[4] = (u_char)((cur - 4) >> 8);
- jpeg_comment[5] = (u_char)(cur - 4);
+ jpeg_comment[4] = (unsigned char)((cur - 4) >> 8);
+ jpeg_comment[5] = (unsigned char)(cur - 4);
return cur;
}
@@ -146,7 +146,7 @@ make_jpeg_comment(u_char *buf, u_char *jpeg_comment)
static int
get_picture_information(GPPort *port,int *pmx_num, int outit)
{
- u_char buforg[PMF_MAXSIZ];
+ unsigned char buforg[PMF_MAXSIZ];
char name[64];
long len;
int i, n;
@@ -217,8 +217,8 @@ get_file(GPPort *port, char *name, CameraFile *file, int format, GPContext *cont
u_long filelen;
u_long total = 0;
long len,jpegcommentlen;
- u_char buf[0x400];
- u_char jpeg_comment[256];
+ unsigned char buf[0x400];
+ unsigned char jpeg_comment[256];
int ret, id;
F1ok(port);
@@ -270,8 +270,8 @@ get_thumbnail(GPPort *port,char *name, CameraFile *file, int format, int n)
u_long total = 0;
long len;
int i;
- u_char buf[0x1000];
- u_char *p;
+ unsigned char buf[0x1000];
+ unsigned char *p;
p = buf;
@@ -316,7 +316,7 @@ get_date_info(GPPort *port, char *name, char *outfilename ,char *newfilename)
int hour = 0;
int minute = 0;
int second = 0;
- u_char buf[128];
+ unsigned char buf[128];
F1ok(port);
F1status(port);