fix a few more warnings
This commit is contained in:
+146
@@ -735,3 +735,149 @@ AC_SUBST(enable_dot)
|
||||
AC_SUBST(enable_html_dox)
|
||||
AC_SUBST(enable_latex_dox)
|
||||
])
|
||||
|
||||
dnl From: http://autoconf-archive.cryp.to/ax_cflags_gcc_option.html
|
||||
dnl Author: Guido Draheim <guidod@gmx.de>
|
||||
dnl Last Modified: 2003-11-04
|
||||
AC_DEFUN([AX_CFLAGS_GCC_OPTION_OLD], [dnl
|
||||
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
|
||||
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$2])dnl
|
||||
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
|
||||
VAR,[VAR="no, unknown"
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
ac_save_[]FLAGS="$[]FLAGS"
|
||||
for ac_arg dnl
|
||||
in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
|
||||
#
|
||||
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
|
||||
AC_TRY_COMPILE([],[return 0;],
|
||||
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
|
||||
done
|
||||
FLAGS="$ac_save_[]FLAGS"
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
case ".$VAR" in
|
||||
.ok|.ok,*) m4_ifvaln($3,$3) ;;
|
||||
.|.no|.no,*) m4_ifvaln($4,$4) ;;
|
||||
*) m4_ifvaln($3,$3,[
|
||||
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
|
||||
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
|
||||
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
|
||||
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
|
||||
fi ]) ;;
|
||||
esac
|
||||
AS_VAR_POPDEF([VAR])dnl
|
||||
AS_VAR_POPDEF([FLAGS])dnl
|
||||
])
|
||||
|
||||
|
||||
dnl the only difference - the LANG selection... and the default FLAGS
|
||||
|
||||
AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_OLD], [dnl
|
||||
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
|
||||
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$2])dnl
|
||||
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
|
||||
VAR,[VAR="no, unknown"
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CXX
|
||||
ac_save_[]FLAGS="$[]FLAGS"
|
||||
for ac_arg dnl
|
||||
in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
|
||||
#
|
||||
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
|
||||
AC_TRY_COMPILE([],[return 0;],
|
||||
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
|
||||
done
|
||||
FLAGS="$ac_save_[]FLAGS"
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
case ".$VAR" in
|
||||
.ok|.ok,*) m4_ifvaln($3,$3) ;;
|
||||
.|.no|.no,*) m4_ifvaln($4,$4) ;;
|
||||
*) m4_ifvaln($3,$3,[
|
||||
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
|
||||
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
|
||||
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
|
||||
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
|
||||
fi ]) ;;
|
||||
esac
|
||||
AS_VAR_POPDEF([VAR])dnl
|
||||
AS_VAR_POPDEF([FLAGS])dnl
|
||||
])
|
||||
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
AC_DEFUN([AX_CFLAGS_GCC_OPTION_NEW], [dnl
|
||||
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
|
||||
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$1])dnl
|
||||
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
|
||||
VAR,[VAR="no, unknown"
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
ac_save_[]FLAGS="$[]FLAGS"
|
||||
for ac_arg dnl
|
||||
in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC
|
||||
#
|
||||
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
|
||||
AC_TRY_COMPILE([],[return 0;],
|
||||
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
|
||||
done
|
||||
FLAGS="$ac_save_[]FLAGS"
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
case ".$VAR" in
|
||||
.ok|.ok,*) m4_ifvaln($3,$3) ;;
|
||||
.|.no|.no,*) m4_ifvaln($4,$4) ;;
|
||||
*) m4_ifvaln($3,$3,[
|
||||
if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
|
||||
then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
|
||||
else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
|
||||
m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
|
||||
fi ]) ;;
|
||||
esac
|
||||
AS_VAR_POPDEF([VAR])dnl
|
||||
AS_VAR_POPDEF([FLAGS])dnl
|
||||
])
|
||||
|
||||
|
||||
dnl the only difference - the LANG selection... and the default FLAGS
|
||||
|
||||
AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_NEW], [dnl
|
||||
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
|
||||
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$1])dnl
|
||||
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
|
||||
VAR,[VAR="no, unknown"
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CXX
|
||||
ac_save_[]FLAGS="$[]FLAGS"
|
||||
for ac_arg dnl
|
||||
in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC
|
||||
#
|
||||
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
|
||||
AC_TRY_COMPILE([],[return 0;],
|
||||
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
|
||||
done
|
||||
FLAGS="$ac_save_[]FLAGS"
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
case ".$VAR" in
|
||||
.ok|.ok,*) m4_ifvaln($3,$3) ;;
|
||||
.|.no|.no,*) m4_ifvaln($4,$4) ;;
|
||||
*) m4_ifvaln($3,$3,[
|
||||
if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
|
||||
then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
|
||||
else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
|
||||
m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
|
||||
fi ]) ;;
|
||||
esac
|
||||
AS_VAR_POPDEF([VAR])dnl
|
||||
AS_VAR_POPDEF([FLAGS])dnl
|
||||
])
|
||||
|
||||
AC_DEFUN([AX_CFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1,
|
||||
[AX_CFLAGS_GCC_OPTION_NEW($@)],[AX_CFLAGS_GCC_OPTION_OLD($@)])])
|
||||
|
||||
AC_DEFUN([AX_CXXFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1,
|
||||
[AX_CXXFLAGS_GCC_OPTION_NEW($@)],[AX_CXXFLAGS_GCC_OPTION_OLD($@)])])
|
||||
|
||||
|
||||
@@ -99,7 +99,6 @@ int
|
||||
time_screen (int rep, int display, int *flags_ptr)
|
||||
{
|
||||
char now[20];
|
||||
char day[16], month[16];
|
||||
int xoffs;
|
||||
int days, hour, min, sec;
|
||||
static int heartbeat = 0;
|
||||
@@ -147,8 +146,8 @@ time_screen (int rep, int display, int *flags_ptr)
|
||||
}
|
||||
|
||||
if (lcd_hgt >= 4) {
|
||||
strcpy (day, shortdays[rtime->tm_wday]);
|
||||
strcpy (month, shortmonths[rtime->tm_mon]);
|
||||
char *day = shortdays[rtime->tm_wday];
|
||||
char *month = shortdays[rtime->tm_wday];
|
||||
|
||||
machine_get_uptime(&uptime, &idle);
|
||||
|
||||
@@ -458,9 +457,13 @@ big_clock_screen (int rep, int display, int *flags_ptr)
|
||||
int
|
||||
mini_clock_screen (int rep, int display, int *flags_ptr)
|
||||
{
|
||||
time_t thetime;
|
||||
struct tm *rtime;
|
||||
struct timeval ttime;
|
||||
static char colon[] = {':', ' '};
|
||||
static int heartbeat = 0;
|
||||
|
||||
// toggle colon display
|
||||
heartbeat ^= 1;
|
||||
|
||||
if ((*flags_ptr & INITIALIZED) == 0) {
|
||||
*flags_ptr |= INITIALIZED;
|
||||
@@ -470,10 +473,10 @@ mini_clock_screen (int rep, int display, int *flags_ptr)
|
||||
sock_send_string (sock, "widget_add N one string\n");
|
||||
}
|
||||
|
||||
gettimeofday(&ttime, NULL);
|
||||
rtime = localtime (&ttime.tv_sec);
|
||||
time (&thetime);
|
||||
rtime = localtime (&thetime);
|
||||
|
||||
sprintf(tmp, "%02d%c%02d", rtime->tm_hour, colon[(ttime.tv_usec / 500000) & 1], rtime->tm_min);
|
||||
sprintf(tmp, "%02d%c%02d", rtime->tm_hour, colon[heartbeat & 0x01], rtime->tm_min);
|
||||
sprintf(buffer, "widget_set N one %d %d {%s}\n",
|
||||
((lcd_wid - 5) / 2) + 1, (lcd_hgt / 2), tmp);
|
||||
sock_send_string (sock, buffer);
|
||||
|
||||
+2
-5
@@ -75,11 +75,8 @@ AC_PROG_RANLIB
|
||||
|
||||
dnl Avoid unused static function warnings
|
||||
CFLAGS="-Wall $CFLAGS"
|
||||
if test "x$GCC" = "xyes"; then
|
||||
# this may produce a harmless warning with older GCC's:
|
||||
# unrecognized option '-Wno-unused-function'
|
||||
CFLAGS="$CFLAGS -Wno-unused-function"
|
||||
fi
|
||||
AX_CFLAGS_GCC_OPTION(-Wno-unused-function)
|
||||
AX_CFLAGS_GCC_OPTION(-ftrampolines)
|
||||
export CFLAGS
|
||||
|
||||
dnl Solaris
|
||||
|
||||
@@ -5,107 +5,33 @@
|
||||
<title>Versioning</title>
|
||||
|
||||
<para>
|
||||
At the time of writing there were four versions of LCDproc floating around on the
|
||||
At the time of writing there were two majors versions of LCDproc floating around on the
|
||||
Internet.
|
||||
</para>
|
||||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term>LCDproc 0.4.1</term>
|
||||
<term>LCDproc 0.4.3 to 0.4.5</term>
|
||||
<listitem>
|
||||
<para>
|
||||
LCDproc 0.4.1 was the last "stable" release of LCDproc. It still uses the old
|
||||
command line configuration.
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
There are known security problems with LCDproc 0.4.1. A remote exploit is possible.
|
||||
An attacker can make use of some buffer-overflows in the client communication
|
||||
code of LCDd, in order to get root access to your system.
|
||||
Therefore running LCDproc 0.4.1 is NOT RECOMMENDED!
|
||||
</para>
|
||||
</warning>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>LCDproc 0.4.2</term>
|
||||
<listitem>
|
||||
<para>
|
||||
LCDproc 0.4.2 was meant to be the next stable release of LCDproc. As 0.4.1
|
||||
it uses the old command line configuration.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
The known issues about 0.4.1 had been fixed. Unfortunately the guy who had the last pending
|
||||
patches on his box kind of "vanished" from the LCDproc mailing list.
|
||||
Of course you can get 0.4.2 from CVS. BUT its current state is unknown.
|
||||
</para>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>LCDproc 0.4.3</term>
|
||||
<listitem>
|
||||
<para>
|
||||
LCDproc 0.4.3 is the current stable release of LCDproc. It no longer uses the old
|
||||
LCDproc 0.4.5 was the last stable release of LCDproc. It no longer uses the old
|
||||
command line configuration, but introduces the configuration file <filename>/etc/LCDd.conf</filename>.
|
||||
As well the driver API has slightly changed, which should not
|
||||
make older drivers incompatible, but might cause some trouble. As well the way
|
||||
<application>LCDd</application> reports messages (including error messages) has changed.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Even though LCDproc 0.4.3 is the most stable version we can offer, it is still not perfect.
|
||||
</para>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>LCDproc 0.4.4</term>
|
||||
<term>LCDproc 0.5.0</term>
|
||||
<listitem>
|
||||
<para>
|
||||
LCDproc 0.4.4 will be the next stable release of LCDproc.
|
||||
LCDproc 0.5.0 is the current stable version of LCDproc. It's recommended that you use this version.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
The 0.4.x branch will only be slightly updated. E.g. we plan better support
|
||||
of lcdproc (the client) for *BSD. Yet, the active development will move to
|
||||
0.5 now.
|
||||
</para>
|
||||
<para>
|
||||
As 0.5 will not be stable in the near future, we may also work on porting drivers
|
||||
from 0.4.1 to 0.4.4 on demand. We do not have all the hardware LCDd supports. So, we
|
||||
only work on drivers that can be tested by YOU.
|
||||
</para>
|
||||
<para>
|
||||
As well, the development and inclusion of new drivers is possible.
|
||||
</para>
|
||||
</note>
|
||||
</listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>LCDproc 0.5</term>
|
||||
<listitem>
|
||||
<para>
|
||||
LCDproc 0.5 is the developement version of LCDproc. Everything is possible ;) Drivers can already be
|
||||
loaded at runtime. We will also work on client supplied menus and other nifty stuff.
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
From time to time LCDproc 0.5 might not even compile due to drastic changes.
|
||||
You have been warned!
|
||||
</para>
|
||||
<para>
|
||||
Furthermore older drivers will NOT work with LCDproc 0.5 AT ALL!
|
||||
Feel free to port a driver that has not been ported to 0.5 yet ;)
|
||||
</para>
|
||||
</warning>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -146,15 +72,6 @@ or
|
||||
Of course you can download the latest stuff from CVS via anonymous login.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Create a "cvs" directory somewhere on your machine (not really neccessary but useful):
|
||||
</para>
|
||||
|
||||
<screen>
|
||||
<prompt>$</prompt> <userinput>mkdir ~/cvs</userinput>
|
||||
<prompt>$</prompt> <userinput>cd ~/cvs</userinput>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
Login to CVS:
|
||||
</para>
|
||||
@@ -172,16 +89,16 @@ Get the files from CVS:
|
||||
</para>
|
||||
|
||||
<screen>
|
||||
<prompt>$</prompt> <userinput>cvs -d:pserver:anonymous@cvs.lcdproc.sourceforge.net:/cvsroot/lcdproc checkout -r stable-0-4-3 lcdproc</userinput>
|
||||
<prompt>$</prompt> <userinput>cvs -d:pserver:anonymous@cvs.lcdproc.sourceforge.net:/cvsroot/lcdproc checkout -r stable-0-5-x lcdproc</userinput>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
Once you've done that and want to update the downloaded files to the latest stuff
|
||||
you can use the "update" command of CVS (Make sure you have logged in to CVS first.):
|
||||
you can use the "update" command of CVS (Make sure to be in the lcdproc directory.):
|
||||
</para>
|
||||
|
||||
<screen>
|
||||
<prompt>$</prompt> <userinput>cvs -d:pserver:anonymous@cvs.lcdproc.sourceforge.net:/cvsroot/lcdproc update -r stable-0-4-3 lcdproc</userinput>
|
||||
<prompt>$</prompt> <userinput>cvs update -d</userinput>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
@@ -189,13 +106,6 @@ Now that you have downloaded the files you can prepare them for compiling, but f
|
||||
you should (you don't have to) copy them to another place on your machine:
|
||||
</para>
|
||||
|
||||
<screen>
|
||||
<prompt>$</prompt> <userinput>mkdir ~/lcdproc-cvs</userinput>
|
||||
<prompt>$</prompt> <userinput>cp -f -R ~/cvs/lcdproc ~/lcdproc-cvs/`date +%Y%m%d`</userinput>
|
||||
<prompt>$</prompt> <userinput>cd ~/lcdproc-cvs/`date +%Y%m%d`</userinput>
|
||||
</screen>
|
||||
|
||||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="apt-get">
|
||||
|
||||
@@ -645,7 +645,7 @@ bayrad_hbar(Driver * drvthis, int x, int y, int len, int promille, int options)
|
||||
MODULE_EXPORT int
|
||||
bayrad_icon(Driver * drvthis, int x, int y, int icon)
|
||||
{
|
||||
//PrivateData *p = drvthis->private_data;
|
||||
/*PrivateData *p = drvthis->private_data;
|
||||
static char icons[3][5*8] = {
|
||||
{
|
||||
1,1,1,1,1, // Empty Heart
|
||||
@@ -675,7 +675,7 @@ bayrad_icon(Driver * drvthis, int x, int y, int icon)
|
||||
0,0,0,0,0,
|
||||
1,0,1,0,1,
|
||||
}
|
||||
};
|
||||
};*/
|
||||
|
||||
switch (icon) {
|
||||
case ICON_BLOCK_FILLED:
|
||||
|
||||
@@ -136,7 +136,7 @@ read_tele(PrivateData *p, char *buffer)
|
||||
&& (zeichen==cc))
|
||||
{
|
||||
buffer[len]=0x00;
|
||||
debug(RPT_DEBUG, "%s: read %s", __FUNCTION__, buffer);
|
||||
/*debug(RPT_DEBUG, "%s: read %s", __FUNCTION__, buffer)*/;
|
||||
return True;
|
||||
}
|
||||
else
|
||||
@@ -204,7 +204,7 @@ real_send_tele(PrivateData *p, char *buffer, int len)
|
||||
/* Take a little nap. This works as a pacemaker */
|
||||
usleep(50);
|
||||
|
||||
debug(RPT_DEBUG, "%s: sent %s", __FUNCTION__, buffer);
|
||||
/*debug(RPT_DEBUG, "%s: sent %s", __FUNCTION__, buffer);*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+9
-4
@@ -128,14 +128,19 @@ handle_input ()
|
||||
void input_send_to_client (Client * c, const char * key)
|
||||
{
|
||||
char * s;
|
||||
size_t size = strlen(key) + sizeof("key %s\n"); // this is large enough
|
||||
|
||||
debug (RPT_DEBUG, "%s( client=[%d], key=\"%.40s\" )", __FUNCTION__, c->sock, key);
|
||||
|
||||
/* Allocate just as much as we need */
|
||||
s = malloc (strlen(key) + strlen("key \n") + 1);
|
||||
sprintf(s, "key %s\n", key);
|
||||
sock_send_string(c->sock, s);
|
||||
free (s);
|
||||
s = calloc (1, size);
|
||||
if (s != NULL) {
|
||||
snprintf(s, size, "key %s\n", key);
|
||||
sock_send_string(c->sock, s);
|
||||
free (s);
|
||||
}
|
||||
else
|
||||
report(RPT_ERR, "%s: malloc failure", __FUNCTION__);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user