u_int* -> uint*

git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@6447 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Till Adam
2003-05-29 07:23:22 +00:00
parent e0682ef23a
commit 86b94becc1
5 changed files with 40 additions and 38 deletions

View File

@@ -36,7 +36,7 @@ static int
benq_wait_for_ready(GPPort *port)
{
int timeout = 30;
u_int8_t ready = 0;
uint8_t ready = 0;
while (timeout--) {
sleep(1);
CHECK (gp_port_usb_msg_read (port, 0x21, 0x0000, 0x0000,
@@ -50,7 +50,7 @@ benq_wait_for_ready(GPPort *port)
int
benq_get_TOC(CameraPrivateLibrary *pl, int *filecount)
{
u_int16_t n_toc_entries;
uint16_t n_toc_entries;
int toc_size = 0;
CHECK (gp_port_usb_msg_read (pl->gpdev, 0x54, 0x0000, 0x0000,
@@ -84,7 +84,7 @@ benq_get_TOC(CameraPrivateLibrary *pl, int *filecount)
int
benq_get_filecount (GPPort *port, int *filecount)
{
u_int16_t response = 0;
uint16_t response = 0;
CHECK (gp_port_usb_msg_read (port, 0x54, 0x0000, 0x0000,
(char*)&response, 0x02));
*filecount = response;
@@ -101,7 +101,7 @@ benq_delete_all (GPPort *port)
int
benq_get_file_name (CameraPrivateLibrary *lib, int index, char *name)
{
u_int8_t *p;
uint8_t *p;
p = lib->toc + index*32;
memcpy (name, p, 8);
@@ -114,7 +114,7 @@ benq_get_file_name (CameraPrivateLibrary *lib, int index, char *name)
int
benq_get_file_size (CameraPrivateLibrary *lib, int index, int *size)
{
u_int8_t *p;
uint8_t *p;
p = lib->toc + index*32;
*size = (p[0x1c] & 0xff)
@@ -127,11 +127,11 @@ benq_get_file_size (CameraPrivateLibrary *lib, int index, int *size)
int
benq_get_file (CameraPrivateLibrary *lib, GPContext *context,
u_int8_t ** data, unsigned int *len, int index, int thumbnail)
uint8_t ** data, unsigned int *len, int index, int thumbnail)
{
u_int32_t file_size = 0, aligned_size = 0;
u_int32_t addr = 0;
u_int8_t *p, *buf;
uint32_t file_size = 0, aligned_size = 0;
uint32_t addr = 0;
uint8_t *p, *buf;
p = lib->toc + index*32;
@@ -167,7 +167,7 @@ benq_get_file (CameraPrivateLibrary *lib, GPContext *context,
int
benq_init (GPPort *port, GPContext *context)
{
u_int8_t bytes[7];
uint8_t bytes[7];
time_t t;
struct tm *ftm;
int i;

View File

@@ -16,6 +16,7 @@
#ifndef __BENQ_H__
#define __BENQ_H__
#include <inttypes.h>
#include <gphoto2.h>
#include <gphoto2-port.h>
@@ -24,7 +25,7 @@
struct _CameraPrivateLibrary
{
GPPort *gpdev;
u_int8_t *toc;
uint8_t *toc;
};
int benq_init(GPPort *port, GPContext *context);
@@ -32,7 +33,7 @@ int benq_init(GPPort *port, GPContext *context);
int benq_get_TOC(CameraPrivateLibrary *pl, int *filecount);
int benq_get_file_name(CameraPrivateLibrary *pl, int index, char *name);
int benq_get_file (CameraPrivateLibrary *lib, GPContext *context,
u_int8_t **buf, unsigned int *len, int index, int thumbnail);
uint8_t **buf, unsigned int *len, int index, int thumbnail);
int benq_get_file_size(CameraPrivateLibrary *pl, int index, int *size);
int benq_get_filecount(GPPort *port, int *filecount);
int benq_delete_all (GPPort *port);

View File

@@ -9,7 +9,7 @@
* 563 - 564 : Image Width(H Byte,L Byte)
*/
#define GSMART_JPG_DEFAULT_HEADER_LENGTH 589
u_int8_t Gsmart_300_JPGDefaultHeader[GSMART_JPG_DEFAULT_HEADER_LENGTH] = {
uint8_t Gsmart_300_JPGDefaultHeader[GSMART_JPG_DEFAULT_HEADER_LENGTH] = {
//SOI(Start of Image)
0xFF,0xD8,
//DQT(Define Quantization Table)
@@ -65,7 +65,7 @@ u_int8_t Gsmart_300_JPGDefaultHeader[GSMART_JPG_DEFAULT_HEADER_LENGTH] = {
};
/* Quantization tables for GSmart300 */
u_int8_t Gsmart_300_QTable[10][64]=
uint8_t Gsmart_300_QTable[10][64]=
{
// index 0, Q85
{ 5, 3, 4, 4, 4, 3, 5, 4, 4, 4, 5, 5, 5, 6, 7, 12,

View File

@@ -57,12 +57,12 @@
#define GP_MODULE "gsmart300"
static int gsmart300_download_data (CameraPrivateLibrary * lib,
int data_type, u_int16_t index, unsigned int size,
u_int8_t * buf);
int data_type, uint16_t index, unsigned int size,
uint8_t * buf);
static int gsmart300_get_FATs (CameraPrivateLibrary * lib);
static int yuv2rgb (int y, int u, int v, int *r, int *g, int *b);
static int gsmart300_get_image_thumbnail (CameraPrivateLibrary * lib,
u_int8_t ** buf, unsigned int *len,
uint8_t ** buf, unsigned int *len,
struct GsmartFile *g_file);
#define __GS300_FAT 0
@@ -85,7 +85,7 @@ int
gsmart300_delete_file (CameraPrivateLibrary * lib, unsigned int index)
{
struct GsmartFile *g_file;
u_int16_t fat_index;
uint16_t fat_index;
CHECK (gsmart300_get_file_info (lib, index, &g_file));
@@ -116,13 +116,13 @@ gsmart300_delete_all (CameraPrivateLibrary * lib)
}
int
gsmart300_request_file (CameraPrivateLibrary * lib, u_int8_t ** buf,
gsmart300_request_file (CameraPrivateLibrary * lib, uint8_t ** buf,
unsigned int *len, unsigned int number)
{
struct GsmartFile *g_file;
u_int8_t *p, *lp_jpg, *start_of_file;
u_int8_t qIndex, value;
u_int8_t *mybuf;
uint8_t *p, *lp_jpg, *start_of_file;
uint8_t qIndex, value;
uint8_t *mybuf;
int i;
/* NOTE : these varialbes are slightly renamed */
int flash_size, data_size, file_size;
@@ -197,7 +197,7 @@ gsmart300_request_file (CameraPrivateLibrary * lib, u_int8_t ** buf,
}
int
gsmart300_request_thumbnail (CameraPrivateLibrary * lib, u_int8_t ** buf,
gsmart300_request_thumbnail (CameraPrivateLibrary * lib, uint8_t ** buf,
unsigned int *len, unsigned int number, int *type)
{
struct GsmartFile *g_file;
@@ -211,16 +211,16 @@ gsmart300_request_thumbnail (CameraPrivateLibrary * lib, u_int8_t ** buf,
static int
gsmart300_get_image_thumbnail (CameraPrivateLibrary * lib, u_int8_t ** buf,
gsmart300_get_image_thumbnail (CameraPrivateLibrary * lib, uint8_t ** buf,
unsigned int *len, struct GsmartFile *g_file)
{
unsigned int size;
u_int8_t *p;
u_int8_t *mybuf = NULL;
u_int8_t *tmp;
uint8_t *p;
uint8_t *mybuf = NULL;
uint8_t *tmp;
unsigned int t_width, t_height;
u_int8_t *yuv_p;
u_int8_t *rgb_p;
uint8_t *yuv_p;
uint8_t *rgb_p;
unsigned char pbm_header[14];
p = g_file->fat;
@@ -320,9 +320,9 @@ gsmart300_reset (CameraPrivateLibrary * lib)
/* buf must be of length n*0x200 */
/* Pictured are pointed by there index which runs over 0 to npic -1*/
static int gsmart300_download_data (CameraPrivateLibrary * lib, int data_type,
u_int16_t index, unsigned int size, u_int8_t * buf)
uint16_t index, unsigned int size, uint8_t * buf)
{
u_int16_t fat_index = 0x1fff - index;
uint16_t fat_index = 0x1fff - index;
int i;
if (data_type == __GS300_FAT)
@@ -350,11 +350,11 @@ static int gsmart300_download_data (CameraPrivateLibrary * lib, int data_type,
static int
gsmart300_get_FATs (CameraPrivateLibrary * lib)
{
u_int8_t type;
uint8_t type;
unsigned int index = 0;
unsigned int file_index = 0;
u_int8_t *p = NULL;
u_int8_t buf[14];
uint8_t *p = NULL;
uint8_t buf[14];
CHECK (gsmart300_get_file_count(lib));

View File

@@ -28,6 +28,7 @@
#ifndef __GSMART300_H__
#define __GSMART300_H__
#include <gphoto2-camera.h>
#include <inttypes.h>
#define FLASH_PAGE_SIZE_300 0x200
#define GSMART_FILE_TYPE_IMAGE 0x00
@@ -40,7 +41,7 @@ struct GsmartFile
int width;
int height;
int index;
u_int8_t *fat;
uint8_t *fat;
int mime_type;
};
@@ -49,7 +50,7 @@ struct _CameraPrivateLibrary
GPPort *gpdev;
int dirty;
int num_files;
u_int8_t *fats;
uint8_t *fats;
struct GsmartFile *files;
};
@@ -60,9 +61,9 @@ int gsmart300_delete_file (CameraPrivateLibrary * lib, unsigned int index);
int gsmart300_delete_all (CameraPrivateLibrary * lib);
int gsmart300_get_file_info (CameraPrivateLibrary * lib, unsigned int index,
struct GsmartFile **file);
int gsmart300_request_file (CameraPrivateLibrary * lib, u_int8_t ** buf,
int gsmart300_request_file (CameraPrivateLibrary * lib, uint8_t ** buf,
unsigned int *len, unsigned int number);
int gsmart300_request_thumbnail (CameraPrivateLibrary * lib, u_int8_t ** buf,
int gsmart300_request_thumbnail (CameraPrivateLibrary * lib, uint8_t ** buf,
unsigned int *len, unsigned int number, int *type);
#endif /* __GSMART300_H__ */