Added CFLAGS -Wall -Wextra to configure.ac
Fixed some compiler warnings related to changed CFLAGS settings.
This commit is contained in:
@@ -9,6 +9,9 @@ AM_INIT_AUTOMAKE
|
|||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AM_PROG_CC_C_O
|
AM_PROG_CC_C_O
|
||||||
|
|
||||||
|
# Compiler flags
|
||||||
|
CFLAGS="$CFLAGS -Wall -Wextra"
|
||||||
|
|
||||||
# Checks for libraries.
|
# Checks for libraries.
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -518,7 +518,7 @@ eb_cmd_encode_value(int id, int elem, char *data, unsigned char *msg, char *buf)
|
|||||||
id, elem, p1, p2, p3, data);
|
id, elem, p1, p2, p3, data);
|
||||||
|
|
||||||
if (strncasecmp(com[id].elem[elem].d_type, "str", 3) == 0) {
|
if (strncasecmp(com[id].elem[elem].d_type, "str", 3) == 0) {
|
||||||
for (i = 0; i < strlen(data); i++)
|
for (i = 0; i < (int) strlen(data); i++)
|
||||||
sprintf((char *) &msg[i * 2], "%02x", data[i]);
|
sprintf((char *) &msg[i * 2], "%02x", data[i]);
|
||||||
|
|
||||||
} else if (strncasecmp(com[id].elem[elem].d_type, "bcd", 3) == 0) {
|
} else if (strncasecmp(com[id].elem[elem].d_type, "bcd", 3) == 0) {
|
||||||
@@ -702,7 +702,7 @@ eb_cmd_prepare(int id, char *data, unsigned char *msg, int *msglen, char *buf)
|
|||||||
|
|
||||||
while (str[j] != '\0') {
|
while (str[j] != '\0') {
|
||||||
byte = str[j];
|
byte = str[j];
|
||||||
if (i < sizeof(in)) {
|
if (i < (int) sizeof(in)) {
|
||||||
|
|
||||||
ret = eb_htoi(&byte);
|
ret = eb_htoi(&byte);
|
||||||
if (ret != -1) {
|
if (ret != -1) {
|
||||||
@@ -975,7 +975,7 @@ eb_cmd_dir_read(const char *cfgdir, const char *extension)
|
|||||||
while (i < files) {
|
while (i < files) {
|
||||||
ext = strrchr(dir[i]->d_name, '.');
|
ext = strrchr(dir[i]->d_name, '.');
|
||||||
if (ext != NULL) {
|
if (ext != NULL) {
|
||||||
if (strlen(ext) == extlen
|
if ((int) strlen(ext) == extlen
|
||||||
&& dir[i]->d_type == DT_REG
|
&& dir[i]->d_type == DT_REG
|
||||||
&& strncasecmp(ext, extprep, extlen) == 0 ) {
|
&& strncasecmp(ext, extprep, extlen) == 0 ) {
|
||||||
memset(file, '\0', sizeof(file));
|
memset(file, '\0', sizeof(file));
|
||||||
|
|||||||
+9
-9
@@ -144,9 +144,9 @@ int
|
|||||||
eb_day_to_str(unsigned char day, char *tgt)
|
eb_day_to_str(unsigned char day, char *tgt)
|
||||||
{
|
{
|
||||||
int dd;
|
int dd;
|
||||||
|
|
||||||
if (dd >= 0x00 && dd <= 0x06) {
|
if ((day & 0x0F) >= 0x00 && (day & 0x0F) <= 0x06) {
|
||||||
eb_bcd_to_int(day, &day);
|
eb_bcd_to_int(day, &dd);
|
||||||
sprintf(tgt, "%s", days[dd]);
|
sprintf(tgt, "%s", days[dd]);
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
@@ -160,9 +160,9 @@ eb_day_to_str(unsigned char day, char *tgt)
|
|||||||
int
|
int
|
||||||
eb_dat_to_str(unsigned char dd, unsigned char mm, unsigned char yy, char *tgt)
|
eb_dat_to_str(unsigned char dd, unsigned char mm, unsigned char yy, char *tgt)
|
||||||
{
|
{
|
||||||
if (dd >= 0x00 && dd <= 0x1F &&
|
if ((dd & 0x7F) >= 0x00 && (dd & 0x7F) <= 0x1F &&
|
||||||
mm >= 0x00 && mm <= 0x0C &&
|
(mm & 0x7F) >= 0x00 && (mm & 0x7F) <= 0x0C &&
|
||||||
yy >= 0x00 && yy <= 0x63 )
|
(yy & 0x7F) >= 0x00 && (yy & 0x7F) <= 0x63 )
|
||||||
sprintf(tgt, "%02d.%02d.%04d", dd, mm, yy + 2000);
|
sprintf(tgt, "%02d.%02d.%04d", dd, mm, yy + 2000);
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
@@ -192,9 +192,9 @@ eb_str_to_dat(int dd, int mm, int yy, unsigned char *tgt)
|
|||||||
int
|
int
|
||||||
eb_tim_to_str(unsigned char hh, unsigned char mm, unsigned char ss, char *tgt)
|
eb_tim_to_str(unsigned char hh, unsigned char mm, unsigned char ss, char *tgt)
|
||||||
{
|
{
|
||||||
if (hh >= 0x00 && hh <= 0x17 &&
|
if ((hh & 0x7F) >= 0x00 && (hh & 0x7F) <= 0x17 &&
|
||||||
mm >= 0x00 && mm <= 0x3B &&
|
(mm & 0x7F) >= 0x00 && (mm & 0x7F) <= 0x3B &&
|
||||||
ss >= 0x00 && ss <= 0x3B )
|
(ss & 0x7F) >= 0x00 && (ss & 0x7F) <= 0x3B )
|
||||||
sprintf(tgt, "%02d:%02d:%02d", hh, mm, ss);
|
sprintf(tgt, "%02d:%02d:%02d", hh, mm, ss);
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
+1
-1
@@ -317,7 +317,7 @@ sock_open(int *fd, int port, int localhost)
|
|||||||
struct sockaddr_in sock;
|
struct sockaddr_in sock;
|
||||||
|
|
||||||
*fd = socket(PF_INET, SOCK_STREAM, 0);
|
*fd = socket(PF_INET, SOCK_STREAM, 0);
|
||||||
err_ret_if(fd < 0, -1);
|
err_ret_if(*fd < 0, -1);
|
||||||
|
|
||||||
/* todo: verify if this realy work */
|
/* todo: verify if this realy work */
|
||||||
/* prevent "Error Address already in use" error message */
|
/* prevent "Error Address already in use" error message */
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ int main() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i < sizeof(data)) {
|
if (i < (int) sizeof(data)) {
|
||||||
ret = eb_htoi(&byte);
|
ret = eb_htoi(&byte);
|
||||||
if (ret != -1) {
|
if (ret != -1) {
|
||||||
data[i] = ret;
|
data[i] = ret;
|
||||||
|
|||||||
+2
-2
@@ -180,7 +180,7 @@ main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i < sizeof(in)) {
|
if (i < (int) sizeof(in)) {
|
||||||
|
|
||||||
ret = eb_htoi(&byte);
|
ret = eb_htoi(&byte);
|
||||||
if (ret != -1) {
|
if (ret != -1) {
|
||||||
@@ -231,7 +231,7 @@ main(int argc, char *argv[])
|
|||||||
j = 0;
|
j = 0;
|
||||||
while (argv[k][j] != '\0') {
|
while (argv[k][j] != '\0') {
|
||||||
byte = argv[k][j];
|
byte = argv[k][j];
|
||||||
if (i < sizeof(in)) {
|
if (i < (int) sizeof(in)) {
|
||||||
|
|
||||||
ret = eb_htoi(&byte);
|
ret = eb_htoi(&byte);
|
||||||
if (ret != -1) {
|
if (ret != -1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user