lots of compiler warnings removed, C++-style comments removed, changed struc initialisation from 'field:value' to '.field=value'

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@771 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
This commit is contained in:
michael
2007-02-25 12:27:26 +00:00
parent 51db519d96
commit 3c851dd7e0
51 changed files with 1897 additions and 1890 deletions
+3
View File
@@ -13,6 +13,9 @@ bin_PROGRAMS = lcd4linux
# Fixme: -W should be renamed to -Wextra someday...
AM_CFLAGS = -D_GNU_SOURCE -Wall -W -fno-strict-aliasing
# use this for lots of warnings
#AM_CFLAGS = -D_GNU_SOURCE -std=c90 -Wall -W -pedantic -Wno-variadic-macros -fno-strict-aliasing
lcd4linux_LDFLAGS =
lcd4linux_LDADD = @DRIVERS@ @PLUGINS@ @DRVLIBS@ @PLUGINLIBS@
lcd4linux_DEPENDENCIES = @DRIVERS@ @PLUGINS@
+3
View File
@@ -209,6 +209,9 @@ CLEANFILES = *~
# Fixme: -W should be renamed to -Wextra someday...
AM_CFLAGS = -D_GNU_SOURCE -Wall -W -fno-strict-aliasing
# use this for lots of warnings
#AM_CFLAGS = -D_GNU_SOURCE -std=c90 -Wall -W -pedantic -Wno-variadic-macros -fno-strict-aliasing
lcd4linux_LDFLAGS =
lcd4linux_LDADD = @DRIVERS@ @PLUGINS@ @DRVLIBS@ @PLUGINLIBS@
lcd4linux_DEPENDENCIES = @DRIVERS@ @PLUGINS@
+1 -1
View File
@@ -31,7 +31,7 @@ extern int running_foreground;
extern int running_background;
extern int verbose_level;
void message(const int level, const char *format, ...) __attribute__ ((format(__printf__, 2, 3)));;
void message(const int level, const char *format, ...) __attribute__ ((format(__printf__, 2, 3)));
#define debug(args...) message (2, __FILE__ ": " args)
#define info(args...) message (1, args)
+4 -4
View File
@@ -395,8 +395,8 @@ int drv_BW_quit(const int quiet)
DRIVER drv_BWCT = {
name:Name,
list:drv_BW_list,
init:drv_BW_init,
quit:drv_BW_quit,
.name = Name,
.list = drv_BW_list,
.init = drv_BW_init,
.quit = drv_BW_quit,
};
+5 -5
View File
@@ -352,7 +352,7 @@ static int drv_BuE_CT_start(const char *section)
/* read version */
drv_generic_serial_write(ESC "?V", 3);
usleep(100000);
if ((len = drv_generic_serial_read(buffer, -sizeof(buffer))) > 0) {
if ((len = drv_generic_serial_read(buffer, -1 * sizeof(buffer))) > 0) {
int v, r, s;
if (sscanf(buffer, "V:%d.%d,%d;", &v, &r, &s) != 3) {
error("%s: error parsing display identification <%*s>", Name, len, buffer);
@@ -728,8 +728,8 @@ int drv_BuE_quit(const int quiet)
DRIVER drv_BeckmannEgle = {
name:Name,
list:drv_BuE_list,
init:drv_BuE_init,
quit:drv_BuE_quit,
.name = Name,
.list = drv_BuE_list,
.init = drv_BuE_init,
.quit = drv_BuE_quit,
};
+4 -4
View File
@@ -1076,8 +1076,8 @@ int drv_CF_quit(const int quiet)
DRIVER drv_Crystalfontz = {
name:Name,
list:drv_CF_list,
init:drv_CF_init,
quit:drv_CF_quit,
.name = Name,
.list = drv_CF_list,
.init = drv_CF_init,
.quit = drv_CF_quit,
};
+4 -4
View File
@@ -366,8 +366,8 @@ int drv_Curs_quit(const int quiet)
DRIVER drv_Curses = {
name:Name,
list:drv_Curs_list,
init:drv_Curs_init,
quit:drv_Curs_quit,
.name = Name,
.list = drv_Curs_list,
.init = drv_Curs_init,
.quit = drv_Curs_quit,
};
+4 -4
View File
@@ -416,8 +416,8 @@ int drv_CW_quit(const int quiet)
DRIVER drv_Cwlinux = {
name:Name,
list:drv_CW_list,
init:drv_CW_init,
quit:drv_CW_quit,
.name = Name,
.list = drv_CW_list,
.init = drv_CW_init,
.quit = drv_CW_quit,
};
+4 -4
View File
@@ -547,8 +547,8 @@ int drv_EA232graphic_quit(const int quiet)
/* use this one for a graphic display */
DRIVER drv_EA232graphic = {
name:Name,
list:drv_EA232graphic_list,
init:drv_EA232graphic_init,
quit:drv_EA232graphic_quit,
.name = Name,
.list = drv_EA232graphic_list,
.init = drv_EA232graphic_init,
.quit = drv_EA232graphic_quit,
};
+4 -4
View File
@@ -584,8 +584,8 @@ int drv_G15_quit(const int quiet)
DRIVER drv_G15 = {
name:Name,
list:drv_G15_list,
init:drv_G15_init,
quit:drv_G15_quit,
.name = Name,
.list = drv_G15_list,
.init = drv_G15_init,
.quit = drv_G15_quit,
};
+4 -4
View File
@@ -1385,8 +1385,8 @@ int drv_HD_quit(const int quiet)
DRIVER drv_HD44780 = {
name:Name,
list:drv_HD_list,
init:drv_HD_init,
quit:drv_HD_quit,
.name = Name,
.list = drv_HD_list,
.init = drv_HD_init,
.quit = drv_HD_quit,
};
+6 -6
View File
@@ -114,14 +114,14 @@ static int drv_IMG_flush_PPM(void)
if (bitbuf == NULL) {
if ((bitbuf = malloc(xsize * ysize * sizeof(*bitbuf))) == NULL) {
error("%s: malloc(%d) failed: %s", Name, xsize * ysize * sizeof(*bitbuf), strerror(errno));
error("%s: malloc(%d) failed: %s", Name, (int) xsize * ysize * sizeof(*bitbuf), strerror(errno));
return -1;
}
}
if (rowbuf == NULL) {
if ((rowbuf = malloc(3 * xsize * sizeof(*rowbuf))) == NULL) {
error("Raster: malloc(%d) failed: %s", 3 * xsize * sizeof(*rowbuf), strerror(errno));
error("Raster: malloc(%d) failed: %s", (int) 3 * xsize * sizeof(*rowbuf), strerror(errno));
return -1;
}
}
@@ -461,8 +461,8 @@ int drv_IMG_quit(const __attribute__ ((unused))
DRIVER drv_Image = {
name:Name,
list:drv_IMG_list,
init:drv_IMG_init,
quit:drv_IMG_quit,
.name = Name,
.list = drv_IMG_list,
.init = drv_IMG_init,
.quit = drv_IMG_quit,
};
+8 -8
View File
@@ -169,13 +169,13 @@ static int drv_L2U_send(int request, int value, int index)
usb_release_interface(lcd, 0);
usb_close(lcd);
// try to close and reopen connection
/* try to close and reopen connection */
if (drv_L2U_open(bus_id, device_id) < 0) {
error("%s: could not re-detect LCD2USB USB LCD", Name);
got_signal = -1;
return -1;
}
// and try to re-send command
/* and try to re-send command */
if (usb_control_msg(lcd, USB_TYPE_VENDOR, request, value, index, NULL, 0, 1000) < 0) {
error("%s: retried USB request failed, aborting!", Name);
got_signal = -1;
@@ -269,10 +269,10 @@ static void drv_L2U_get_controllers(void)
error("%s: no controllers found", Name);
} else {
error("%s: unable to read installed controllers", Name);
controllers = 0; // don't access any controllers
controllers = 0; /* don't access any controllers */
}
// convert into controller map matching our protocol
/* convert into controller map matching our protocol */
controllers = ((controllers & 1) ? LCD_CTRL_0 : 0) | ((controllers & 2) ? LCD_CTRL_1 : 0);
}
@@ -673,8 +673,8 @@ int drv_L2U_quit(const int quiet)
DRIVER drv_LCD2USB = {
name:Name,
list:drv_L2U_list,
init:drv_L2U_init,
quit:drv_L2U_quit,
.name = Name,
.list = drv_L2U_list,
.init = drv_L2U_init,
.quit = drv_L2U_quit,
};
+4 -4
View File
@@ -360,8 +360,8 @@ int drv_LL_quit(const int quiet)
DRIVER drv_LCDLinux = {
name:Name,
list:drv_LL_list,
init:drv_LL_init,
quit:drv_LL_quit,
.name = Name,
.list = drv_LL_list,
.init = drv_LL_init,
.quit = drv_LL_quit,
};
+4 -4
View File
@@ -284,8 +284,8 @@ int drv_LT_quit(const int quiet)
DRIVER drv_LCDTerm = {
name:Name,
list:drv_LT_list,
init:drv_LT_init,
quit:drv_LT_quit,
.name = Name,
.list = drv_LT_list,
.init = drv_LT_init,
.quit = drv_LT_quit,
};
+11 -11
View File
@@ -66,7 +66,7 @@
#include "drv.h"
#include "drv_generic_graphic.h"
// display command bytes
/* display command bytes */
#define DSP_CMD_ECHO 0
#define DSP_CMD_NOP 1
#define DSP_CMD_IMAGE 2
@@ -78,7 +78,7 @@
#define DSP_MEM (80 * 32 * 2 / 8)
#define DEFAULT_X_OFFSET 1 // with a font width of 6
#define DEFAULT_X_OFFSET 1 /* with a font width of 6 */
static char Name[] = "LEDMatrix";
static char *IPAddress = NULL;
@@ -115,7 +115,7 @@ static void drv_LEDMatrix_blit(const int row, const int col, const int height, c
}
}
// scan entire display
/* scan entire display */
tx_buffer[0] = DSP_CMD_IMAGE;
do {
@@ -130,13 +130,13 @@ static void drv_LEDMatrix_blit(const int row, const int col, const int height, c
tv.tv_sec = 0;
tv.tv_usec = 100000;
// wait 1 sec for ack
/* wait 1 sec for ack */
if ((i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv)) < 0) {
info("%s: Select error: %s", Name, strerror(errno));
}
if (FD_ISSET(sock, &rfds)) {
// wait for ack
/* wait for ack */
fromlen = sizeof(dsp_addr);
i = recvfrom(sock, reply, sizeof(reply), 0, (struct sockaddr *) &cli_addr, &fromlen);
if (i < 0) {
@@ -145,8 +145,8 @@ static void drv_LEDMatrix_blit(const int row, const int col, const int height, c
if ((i == 2) && (reply[0] == DSP_CMD_ACK) && (reply[1] == DSP_CMD_IMAGE)) {
ack = 1;
} else if ((i > 1) && (reply[0] == DSP_CMD_IR)) {
// maybe used later:
// ir_receive(reply+1, i-1);
/* maybe used later: */
/* ir_receive(reply+1, i-1); */
} else {
info("%s: Unexpected reply message", Name);
}
@@ -313,8 +313,8 @@ int drv_LEDMatrix_quit(const __attribute__ ((unused))
DRIVER drv_LEDMatrix = {
name:Name,
list:drv_LEDMatrix_list,
init:drv_LEDMatrix_init,
quit:drv_LEDMatrix_quit,
.name = Name,
.list = drv_LEDMatrix_list,
.init = drv_LEDMatrix_init,
.quit = drv_LEDMatrix_quit,
};
+9 -9
View File
@@ -163,7 +163,8 @@ static void drv_L7_clear(void)
static void drv_L7_blit(const int row, const int col, const int height, const int width)
{
int r, p;
int r, p, c, a;
unsigned char m;
/* transfer layout to display framebuffer */
for (r = row; r < row + height; r++) {
@@ -171,15 +172,14 @@ static void drv_L7_blit(const int row, const int col, const int height, const in
if (r >= SROWS - 1)
break;
/* page */
int p = r / 8;
int c;
p = r / 8;
for (c = col; c < col + width; c++) {
if (c >= SCOLS)
break;
/* RAM address */
int a = p * SCOLS + c;
a = p * SCOLS + c;
/* bit mask */
unsigned char m = 1 << (r % 8);
m = 1 << (r % 8);
if (drv_generic_graphic_black(r, c)) {
/* set bit */
Buffer1[a] |= m;
@@ -521,8 +521,8 @@ int drv_L7_quit(const int quiet)
DRIVER drv_LPH7508 = {
name:Name,
list:drv_L7_list,
init:drv_L7_init,
quit:drv_L7_quit,
.name = Name,
.list = drv_L7_list,
.init = drv_L7_init,
.quit = drv_L7_quit,
};
+4 -4
View File
@@ -329,8 +329,8 @@ int drv_LUIse_quit(const int quiet)
/* use this one for a graphic display */
DRIVER drv_LUIse = {
name:Name,
list:drv_LUIse_list,
init:drv_LUIse_init,
quit:drv_LUIse_quit,
.name = Name,
.list = drv_LUIse_list,
.init = drv_LUIse_init,
.quit = drv_LUIse_quit,
};
+4 -4
View File
@@ -681,8 +681,8 @@ int drv_M5_quit(const int quiet)
DRIVER drv_M50530 = {
name:Name,
list:drv_M5_list,
init:drv_M5_init,
quit:drv_M5_quit,
.name = Name,
.list = drv_M5_list,
.init = drv_M5_init,
.quit = drv_M5_quit,
};
+4 -4
View File
@@ -550,8 +550,8 @@ int drv_MO_quit(const int quiet)
DRIVER drv_MatrixOrbital = {
name:Name,
list:drv_MO_list,
init:drv_MO_init,
quit:drv_MO_quit,
.name = Name,
.list = drv_MO_list,
.init = drv_MO_init,
.quit = drv_MO_quit,
};
+4 -4
View File
@@ -278,8 +278,8 @@ int drv_MI_quit(const int quiet)
DRIVER drv_MilfordInstruments = {
name:Name,
list:drv_MI_list,
init:drv_MI_init,
quit:drv_MI_quit,
.name = Name,
.list = drv_MI_list,
.init = drv_MI_init,
.quit = drv_MI_quit,
};
+4 -4
View File
@@ -188,8 +188,8 @@ int drv_NULL_quit(const __attribute__ ((unused))
DRIVER drv_NULL = {
name:Name,
list:drv_NULL_list,
init:drv_NULL_init,
quit:drv_NULL_quit,
.name = Name,
.list = drv_NULL_list,
.init = drv_NULL_init,
.quit = drv_NULL_quit,
};
+7 -5
View File
@@ -140,8 +140,10 @@ static void drv_GU311_wait_busy(void)
static void drv_GU311_send_char(char c)
{
//drv_GU311_wait_busy(); /* ensuite the display is ready to take the command */
#if 0
/* Disabled because all the cables does not have the busy line linked. */
drv_GU311_wait_busy(); /* ensuite the display is ready to take the command */
#endif
drv_generic_parport_data(c);
ndelay(30); /* delay to ensure data line stabilisation on long cables */
drv_generic_parport_control(SIGNAL_WR, 0); /* write line to enable */
@@ -380,8 +382,8 @@ int drv_Noritake_quit(const int quiet)
DRIVER drv_Noritake = {
name:Name,
list:drv_Noritake_list,
init:drv_Noritake_init,
quit:drv_Noritake_quit,
.name = Name,
.list = drv_Noritake_list,
.init = drv_Noritake_init,
.quit = drv_Noritake_quit,
};
+29 -30
View File
@@ -206,8 +206,8 @@ static int drv_RB_sock_init()
memset(sacl, 0, sizeof(struct sockaddr_in));
sacl->sin_family = AF_INET;
sacl->sin_port = htons(3333); //Listen Port
sacl->sin_addr.s_addr = inet_addr("127.0.0.1"); //Listen Address
sacl->sin_port = htons(3333); /* Listen Port */
sacl->sin_addr.s_addr = inet_addr("127.0.0.1"); /* Listen Address */
if ((sock_c = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
error("Socket open failed");
@@ -294,7 +294,7 @@ static void drv_RB_command(const unsigned char cmd, const int delay)
ndelay(T_AS);
drv_RB_outw(cmd);
// wait for command completion
/* wait for command completion */
udelay(delay);
}
@@ -317,7 +317,7 @@ static void drv_RB_data(const char *string, const int len, const int delay)
ndelay(T_AS);
drv_RB_outw(ch | LCD_AFDX);
// wait for command completion
/* wait for command completion */
udelay(delay);
}
@@ -642,53 +642,52 @@ int drv_RB_quit(const int quiet)
DRIVER drv_RouterBoard = {
name:Name,
list:drv_RB_list,
init:drv_RB_init,
quit:drv_RB_quit,
.name = Name,
.list = drv_RB_list,
.init = drv_RB_init,
.quit = drv_RB_quit,
};
/*
#if 0
Simple example to send led status to port 3333
#include <stdio.h>
#include <arpa/inet.h>
#include <errno.h>
int send_packet (unsigned char leds)
int send_packet(unsigned char leds)
{
struct sockaddr_in *sas;
int sock;
char msg[20];
msg[0]=leds;
msg[1]=0;
msg[0] = leds;
msg[1] = 0;
if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
fprintf(stderr, "Socket option failed.\n");
return -1;
}
if (( sas = (struct sockaddr_in *) malloc(sizeof(struct sockaddr_in))) == NULL)
return -1 ;
memset( sas, 0, sizeof(struct sockaddr_in));
if ((sas = (struct sockaddr_in *) malloc(sizeof(struct sockaddr_in))) == NULL)
return -1;
memset(sas, 0, sizeof(struct sockaddr_in));
sas->sin_family = AF_INET;
sas->sin_port = htons(3333);
sas->sin_addr.s_addr = inet_addr("127.0.0.1");
if(sendto(sock,msg,6, 0, (struct sockaddr *) sas, sizeof(struct sockaddr_in)) > 0)
{ free(sas);
if (sendto(sock, msg, 6, 0, (struct sockaddr *) sas, sizeof(struct sockaddr_in)) > 0) {
free(sas);
return 1;
} //sent ok to dest
}
/* sent ok to dest */
free(sas);
return -1; //Send failed
return -1; /* Send failed */
}
int main ()
{
send_packet(0x03);
return 0;
}
*/
int main()
{
send_packet(0x03);
return 0;
}
#endif
+8 -8
View File
@@ -585,17 +585,17 @@ int drv_Sample_quit2(const int quiet)
/* use this one for a text display */
DRIVER drv_Sample = {
name:Name,
list:drv_Sample_list,
init:drv_Sample_init,
quit:drv_Sample_quit,
.name = Name,
.list = drv_Sample_list,
.init = drv_Sample_init,
.quit = drv_Sample_quit,
};
/* use this one for a graphic display */
DRIVER drv_Sample2 = {
name:Name,
list:drv_Sample_list,
init:drv_Sample_init2,
quit:drv_Sample_quit2,
.name = Name,
.list = drv_Sample_list,
.init = drv_Sample_init2,
.quit = drv_Sample_quit2,
};
+4 -4
View File
@@ -343,8 +343,8 @@ int drv_SL_quit(const int quiet)
DRIVER drv_SimpleLCD = {
name:Name,
list:drv_SL_list,
init:drv_SL_init,
quit:drv_SL_quit,
.name = Name,
.list = drv_SL_list,
.init = drv_SL_init,
.quit = drv_SL_quit,
};
+4 -4
View File
@@ -569,8 +569,8 @@ int drv_T6_quit(const int quiet)
DRIVER drv_T6963 = {
name:Name,
list:drv_T6_list,
init:drv_T6_init,
quit:drv_T6_quit,
.name = Name,
.list = drv_T6_list,
.init = drv_T6_init,
.quit = drv_T6_quit,
};
+21 -21
View File
@@ -126,22 +126,22 @@ static int drv_TF_close(void)
}
static void drv_TF_send(char *data, int size)
static void drv_TF_send(unsigned char *data, int size)
{
char buffer[64];
unsigned char buffer[64];
/* the controller always wants a 64-byte packet */
memset(buffer, 0, 64);
memcpy(buffer, data, size);
// Endpoint hardcoded to 2
usb_bulk_write(lcd, 2, buffer, 64, 2000);
/* Endpoint hardcoded to 2 */
usb_bulk_write(lcd, 2, (char *) buffer, 64, 2000);
}
static void drv_TF_command(const unsigned char cmd)
{
char buffer[4] = { PKT_START, PKT_CTRL, 0, PKT_END };
unsigned char buffer[4] = { PKT_START, PKT_CTRL, 0, PKT_END };
buffer[2] = cmd;
drv_TF_send(buffer, 4);
}
@@ -155,27 +155,27 @@ static void drv_TF_clear(void)
static void drv_TF_write(const int row, const int col, const char *data, const int len)
{
char buffer[64];
char *p;
unsigned char buffer[64];
unsigned char *p;
int pos = 0;
if (DCOLS == 8 && DROWS == 1) { // 8x1 Characters
if (DCOLS == 8 && DROWS == 1) { /* 8x1 Characters */
pos = row * 0x40 + col;
} else if (DCOLS == 16 && DROWS == 2) { // 16x2 Characters
} else if (DCOLS == 16 && DROWS == 2) { /* 16x2 Characters */
pos = row * 0x40 + col;
} else if (DCOLS == 20 && DROWS == 4) { // 20x4 Characters
} else if (DCOLS == 20 && DROWS == 4) { /* 20x4 Characters */
pos = row * 0x20 + col;
} else {
error("%s: internal error: DCOLS=%d DROWS=%d", Name, DCOLS, DROWS);
return;
}
// combine the GOTO and the data into one packet
/* combine the GOTO and the data into one packet */
p = buffer;
*p++ = PKT_START;
*p++ = PKT_CTRL; // Goto
*p++ = PKT_CTRL; /* Goto */
*p++ = 0x80 | pos;
*p++ = PKT_DATA; // Data
*p++ = PKT_DATA; /* Data */
*p++ = (char) len;
for (pos = 0; pos < len; pos++) {
*p++ = *data++;
@@ -189,8 +189,8 @@ static void drv_TF_write(const int row, const int col, const char *data, const i
static void drv_TF_defchar(const int ascii, const unsigned char *matrix)
{
char buffer[14];
char *p;
unsigned char buffer[14];
unsigned char *p;
int i;
p = buffer;
@@ -210,7 +210,7 @@ static void drv_TF_defchar(const int ascii, const unsigned char *matrix)
static int drv_TF_backlight(int backlight)
{
char buffer[4] = { PKT_START, PKT_BACKLIGHT, 0, PKT_END };
unsigned char buffer[4] = { PKT_START, PKT_BACKLIGHT, 0, PKT_END };
if (backlight < 0)
backlight = 0;
@@ -224,7 +224,7 @@ static int drv_TF_backlight(int backlight)
}
// test for existing resolutions from TREFON USB-LCDs (TEXT-Mode only)
/* test for existing resolutions from TREFON USB-LCDs (TEXT-Mode only) */
int drv_TF_valid_resolution(int rows, int cols)
{
@@ -411,8 +411,8 @@ int drv_TF_quit(const int quiet)
DRIVER drv_Trefon = {
name:Name,
list:drv_TF_list,
init:drv_TF_init,
quit:drv_TF_quit,
.name = Name,
.list = drv_TF_list,
.init = drv_TF_init,
.quit = drv_TF_quit,
};
+7 -7
View File
@@ -62,8 +62,8 @@ static char Name[] = "USBHUB";
* no Vendor/Product specified in config.
*/
static int hubVendor = 0x0409;
static int hubProduct = 0x0058;
static unsigned int hubVendor = 0x0409;
static unsigned int hubProduct = 0x0058;
static usb_dev_handle *hub = NULL;
@@ -298,7 +298,7 @@ int drv_UH_init(const char *section, const int quiet)
}
sleep(1);
for (i = 0; i < GPOS; ++i) {
drv_UH_set(i, 3); // OFF
drv_UH_set(i, 3); /* OFF */
}
}
@@ -333,8 +333,8 @@ int drv_UH_quit(const int quiet)
DRIVER drv_USBHUB = {
name:Name,
list:drv_UH_list,
init:drv_UH_init,
quit:drv_UH_quit,
.name = Name,
.list = drv_UH_list,
.init = drv_UH_init,
.quit = drv_UH_quit,
};
+5 -5
View File
@@ -161,7 +161,7 @@ static void drv_UL_send(void)
if (use_libusb) {
#ifdef HAVE_USB_H
// Fixme: Endpoint hardcoded to 1 ???
/* Fixme: Endpoint hardcoded to 1 ??? */
usb_bulk_write(lcd, 1, Buffer, BufPtr - Buffer, 1000);
#endif
} else {
@@ -503,8 +503,8 @@ int drv_UL_quit(const int quiet)
DRIVER drv_USBLCD = {
name:Name,
list:drv_UL_list,
init:drv_UL_init,
quit:drv_UL_quit,
.name = Name,
.list = drv_UL_list,
.init = drv_UL_init,
.quit = drv_UL_quit,
};
+5 -5
View File
@@ -140,7 +140,7 @@ static int drv_WN_start(const char *section, const int quiet)
drv_generic_serial_write(ESC "[0c", 4);
usleep(100 * 1000);
if ((len = drv_generic_serial_read(buffer, -sizeof(buffer))) > 0) {
if ((len = drv_generic_serial_read(buffer, -1 * sizeof(buffer))) > 0) {
info("%s: waiting 15 seconds for selftest", Name);
drv_generic_serial_write(buffer, len);
sleep(15);
@@ -269,8 +269,8 @@ int drv_WN_quit(const int quiet)
DRIVER drv_WincorNixdorf = {
name:Name,
list:drv_WN_list,
init:drv_WN_init,
quit:drv_WN_quit,
.name = Name,
.list = drv_WN_list,
.init = drv_WN_init,
.quit = drv_WN_quit,
};
+4 -4
View File
@@ -368,8 +368,8 @@ int drv_X11_quit(const __attribute__ ((unused))
DRIVER drv_X11 = {
name:Name,
list:drv_X11_list,
init:drv_X11_init,
quit:drv_X11_quit,
.name = Name,
.list = drv_X11_list,
.init = drv_X11_init,
.quit = drv_X11_quit,
};
+4 -4
View File
@@ -81,10 +81,10 @@
#endif
/* pixel colors */
RGBA FG_COL = { R: 0x00, G: 0x00, B: 0x00, A:0xff };
RGBA BG_COL = { R: 0xff, G: 0xff, B: 0xff, A:0xff };
RGBA BL_COL = { R: 0xff, G: 0xff, B: 0xff, A:0x00 };
RGBA NO_COL = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
RGBA FG_COL = {.R = 0x00,.G = 0x00,.B = 0x00,.A = 0xff };
RGBA BG_COL = {.R = 0xff,.G = 0xff,.B = 0xff,.A = 0xff };
RGBA BL_COL = {.R = 0xff,.G = 0xff,.B = 0xff,.A = 0x00 };
RGBA NO_COL = {.R = 0x00,.G = 0x00,.B = 0x00,.A = 0x00 };
static char *Section = NULL;
static char *Driver = NULL;
+2 -2
View File
@@ -167,7 +167,7 @@ void drv_generic_i2c_data(const unsigned char data)
}
void drv_generic_i2c_command(const unsigned char command, const unsigned char *data, const unsigned char length)
void drv_generic_i2c_command(const unsigned char command, /*const */ unsigned char *data, const unsigned char length)
{
i2c_smbus_write_block_data(i2c_device, command, length, (unsigned char *) data);
i2c_smbus_write_block_data(i2c_device, command, length, data);
}
+1 -1
View File
@@ -56,6 +56,6 @@ int drv_generic_i2c_open(const char *section, const char *driver);
int drv_generic_i2c_close(void);
unsigned char drv_generic_i2c_wire(const char *name, const char *deflt);
void drv_generic_i2c_data(const unsigned char data);
void drv_generic_i2c_command(const unsigned char command, const unsigned char *data, const unsigned char length);
void drv_generic_i2c_command(const unsigned char command, /*const */ unsigned char *data, const unsigned char length);
#endif
+1 -1
View File
@@ -777,7 +777,7 @@ static void drv_generic_text_bar_pack_segments(void)
for (i = 0; i < nSegment; i++) {
for (j = 0; j < nSegment; j++) {
error[i][j] = drv_generic_text_bar_segment_error(i, j);
// debug ("[%d][%d] = %d", i, j, error[i][j]);
/* debug ("[%d][%d] = %d", i, j, error[i][j]); */
}
}
+4 -4
View File
@@ -464,8 +464,8 @@ int drv_pL_quit(const int quiet)
DRIVER drv_picoLCD = {
name:Name,
list:drv_pL_list,
init:drv_pL_init,
quit:drv_pL_quit,
.name = Name,
.list = drv_pL_list,
.init = drv_pL_init,
.quit = drv_pL_quit,
};
+4 -4
View File
@@ -337,8 +337,8 @@ int drv_SD_quit(const int quiet)
DRIVER drv_serdisplib = {
name:Name,
list:drv_SD_list,
init:drv_SD_init,
quit:drv_SD_quit,
.name = Name,
.list = drv_SD_list,
.init = drv_SD_init,
.quit = drv_SD_quit,
};
+808 -808
View File
File diff suppressed because it is too large Load Diff
+808 -808
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -113,7 +113,7 @@ static int parse_i2c_sensors_sysfs(const char *key)
fgets(buffer, sizeof(buffer), stream);
fclose(stream);
if (!buffer) {
if (buffer[0] == '\0') {
error("i2c_sensors: %s empty ?!", file);
return -1;
}
@@ -183,7 +183,7 @@ static int parse_i2c_sensors_procfs(const char *key)
fgets(buffer, sizeof(buffer), stream);
fclose(stream);
if (!buffer) {
if (buffer[0] == '\0') {
error("i2c_sensors: %s empty ?!", file);
return -1;
}
+27 -27
View File
@@ -62,7 +62,7 @@
#define HTTP_REQUEST "/webfgi/StopInfoInplace.aspx?ID=%s"
#define USER_AGENT "lcd4linux - KVV plugin (http://ssl.bulix.org/projects/lcd4linux/wiki/plugin_kvv)"
#define DEFAULT_STATION_ID "89" // Hauptbahnhof
#define DEFAULT_STATION_ID "89" /* Hauptbahnhof */
/* example ids:
* 89 = Hauptbahnhof
@@ -107,9 +107,9 @@ static int get_element(char *input, char *name, char **data)
{
int skip = 0;
int len = 0;
int state = 0; // nothing found yet
int state = 0; /* nothing found yet */
// search entire string
/* search entire string */
while (*input) {
if (skip == 0) {
@@ -122,7 +122,7 @@ static int get_element(char *input, char *name, char **data)
break;
case 1:
// ignore white spaces
/* ignore white spaces */
if (*input != ' ') {
if (strncasecmp(input, name, strlen(name)) == 0) {
state = 2;
@@ -157,11 +157,11 @@ static int get_attrib(char *input, char *name, char **data)
{
int skip = 0;
int len = 0;
int state = 0; // nothing found
int state = 0; /* nothing found */
// search in this element
/* search in this element */
while (*input != '>') {
// ignore white spaces
/* ignore white spaces */
if (((*input != ' ') && (*input != '\t')) && (skip == 0)) {
switch (state) {
case 0:
@@ -241,7 +241,7 @@ static int http_open(char *name)
static void get_text(char *input, char *end, char *dest, int dlen)
{
int state = 0; // nothing yet, outside any element
int state = 0; /* nothing yet, outside any element */
int cnt = 0;
while (*input) {
@@ -307,19 +307,19 @@ static void process_station_string(char *str)
/* erase multiple spaces and replace umlauts */
p = q = str;
last = 1; // no leading spaces
last = 1; /* no leading spaces */
while (*p) {
if ((!last) || (*p != ' ')) {
/* translate from latin1 to hd44780 */
if (*p == (char) 228) // lower a umlaut
*q++ = 0xe1;
else if (*p == (char) 223) // sz ligature
*q++ = 0xe2;
else if (*p == (char) 246) // lower o umlaut
*q++ = 0xef;
else if (*p == (char) 252) // lower u umlaut
*q++ = 0xf5;
if (*p == (char) 228) /* lower a umlaut */
*q++ = (char) 0xe1;
else if (*p == (char) 223) /* sz ligature */
*q++ = (char) 0xe2;
else if (*p == (char) 246) /* lower o umlaut */
*q++ = (char) 0xef;
else if (*p == (char) 252) /* lower u umlaut */
*q++ = (char) 0xf5;
else
*q++ = *p;
}
@@ -370,7 +370,7 @@ static void kvv_client( __attribute__ ((unused))
error("[KVV] Error accessing server/proxy: %s", strerror(errno));
return;
}
// create and set get request
/* create and set get request */
if (snprintf(obuffer, sizeof(obuffer),
"GET http://%s" HTTP_REQUEST " HTTP/1.1\n"
"Host: %s\n" "User-Agent: " USER_AGENT "\n\n", server_name, station_id,
@@ -406,7 +406,7 @@ static void kvv_client( __attribute__ ((unused))
}
while (i > 0);
ibuffer[count] = 0; // terminate string
ibuffer[count] = 0; /* terminate string */
close(sock);
if (!count)
@@ -416,11 +416,11 @@ static void kvv_client( __attribute__ ((unused))
char *input, *cookie, *name, *value;
int input_len, cookie_len, name_len, value_len;
// buffer to html encode value
/* buffer to html encode value */
char value_enc[512];
int value_enc_len;
// find cookie
/* find cookie */
cookie_len = 0;
cookie = strstr(ibuffer, "Set-Cookie:");
if (cookie) {
@@ -432,7 +432,7 @@ static void kvv_client( __attribute__ ((unused))
while (cookie[cookie_len] != ';')
cookie_len++;
}
// find input element
/* find input element */
input_len = get_element(ibuffer, "input", &input);
@@ -467,7 +467,7 @@ static void kvv_client( __attribute__ ((unused))
sock = http_open(connect_to);
// send POST
/* send POST */
if (snprintf(obuffer, sizeof(obuffer),
"POST http://%s" HTTP_REQUEST " HTTP/1.1\n"
"Host: %s\n"
@@ -506,7 +506,7 @@ static void kvv_client( __attribute__ ((unused))
ibuffer[count] = 0;
// printf("Result (%d):\n%s\n", count, ibuffer);
/* printf("Result (%d):\n%s\n", count, ibuffer); */
/* close connection */
close(sock);
@@ -528,7 +528,7 @@ static void kvv_client( __attribute__ ((unused))
if (strstr(ibuffer, "Die Daten konnten nicht abgefragt werden.") != NULL) {
info("[KVV] Server returned error!");
// printf("%s\n", ibuffer);
/* printf("%s\n", ibuffer); */
shm->error = 1;
} else
shm->error = 0;
@@ -572,13 +572,13 @@ static void kvv_client( __attribute__ ((unused))
get_text(td, "td", str, sizeof(str));
if (shm->entries < MAX_LINES) {
// allocate a new slot
/* allocate a new slot */
shm->entries++;
shm->entry[shm->entries - 1].time = -1;
memset(shm->entry[shm->entries - 1].line, 0, MAX_LINE_LENGTH + 1);
memset(shm->entry[shm->entries - 1].station, 0, MAX_STATION_LENGTH + 1);
// add new lines entry
/* add new lines entry */
strncpy(shm->entry[shm->entries - 1].line, str, MAX_LINE_LENGTH);
} else
overflow = 1; /* don't add further entries */
+1 -1
View File
@@ -73,7 +73,7 @@ static int configure_mysql(void)
static int configured = 0;
char server[256];
unsigned int port;
int port;
char user[128];
char password[256];
char database[256];
+1 -1
View File
@@ -1 +1 @@
#define SVN_VERSION "766M"
#define SVN_VERSION "770M"
+5 -5
View File
@@ -214,9 +214,9 @@ int widget_bar_quit(WIDGET * Self)
WIDGET_CLASS Widget_Bar = {
name:"bar",
type:WIDGET_TYPE_RC,
init:widget_bar_init,
draw:NULL,
quit:widget_bar_quit,
.name = "bar",
.type = WIDGET_TYPE_RC,
.init = widget_bar_init,
.draw = NULL,
.quit = widget_bar_quit,
};
+5 -5
View File
@@ -119,9 +119,9 @@ int widget_gpo_quit(WIDGET * Self)
WIDGET_CLASS Widget_GPO = {
name:"gpo",
type:WIDGET_TYPE_GPO,
init:widget_gpo_init,
draw:NULL,
quit:widget_gpo_quit,
.name = "gpo",
.type = WIDGET_TYPE_GPO,
.init = widget_gpo_init,
.draw = NULL,
.quit = widget_gpo_quit,
};
+5 -5
View File
@@ -193,9 +193,9 @@ int widget_icon_quit(WIDGET * Self)
WIDGET_CLASS Widget_Icon = {
name:"icon",
type:WIDGET_TYPE_RC,
init:widget_icon_init,
draw:NULL,
quit:widget_icon_quit,
.name = "icon",
.type = WIDGET_TYPE_RC,
.init = widget_icon_init,
.draw = NULL,
.quit = widget_icon_quit,
};
+7 -7
View File
@@ -79,7 +79,7 @@ static void widget_image_render(const char *Name, WIDGET_IMAGE * Image)
if (Image->bitmap) {
int i;
for (i = 0; i < Image->height * Image->width; i++) {
RGBA empty = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
RGBA empty = {.R = 0x00,.G = 0x00,.B = 0x00,.A = 0x00 };
Image->bitmap[i] = empty;
}
}
@@ -138,7 +138,7 @@ static void widget_image_render(const char *Name, WIDGET_IMAGE * Image)
return;
}
for (i = 0; i < Image->height * Image->width; i++) {
RGBA empty = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
RGBA empty = {.R = 0x00,.G = 0x00,.B = 0x00,.A = 0x00 };
Image->bitmap[i] = empty;
}
}
@@ -282,9 +282,9 @@ int widget_image_quit(WIDGET * Self)
WIDGET_CLASS Widget_Image = {
name:"image",
type:WIDGET_TYPE_XY,
init:widget_image_init,
draw:NULL,
quit:widget_image_quit,
.name = "image",
.type = WIDGET_TYPE_XY,
.init = widget_image_init,
.draw = NULL,
.quit = widget_image_quit,
};
+6 -6
View File
@@ -135,10 +135,10 @@ int widget_keypad_quit(WIDGET * Self)
WIDGET_CLASS Widget_Keypad = {
name:"keypad",
type:WIDGET_TYPE_KEYPAD,
init:widget_keypad_init,
draw:widget_keypad_draw,
find:widget_keypad_find,
quit:widget_keypad_quit,
.name = "keypad",
.type = WIDGET_TYPE_KEYPAD,
.init = widget_keypad_init,
.draw = widget_keypad_draw,
.find = widget_keypad_find,
.quit = widget_keypad_quit,
};
+5 -5
View File
@@ -338,9 +338,9 @@ int widget_text_quit(WIDGET * Self)
WIDGET_CLASS Widget_Text = {
name:"text",
type:WIDGET_TYPE_RC,
init:widget_text_init,
draw:NULL,
quit:widget_text_quit,
.name = "text",
.type = WIDGET_TYPE_RC,
.init = widget_text_init,
.draw = NULL,
.quit = widget_text_quit,
};
+5 -5
View File
@@ -137,9 +137,9 @@ int widget_timer_register(void)
WIDGET_CLASS Widget_Timer = {
name:"timer",
type:WIDGET_TYPE_TIMER,
init:widget_timer_init,
draw:NULL,
quit:widget_timer_quit,
.name = "timer",
.type = WIDGET_TYPE_TIMER,
.init = widget_timer_init,
.draw = NULL,
.quit = widget_timer_quit,
};