|
From: <mla...@us...> - 2006-11-16 11:12:32
|
Revision: 160
http://svn.sourceforge.net/g15daemon/?rev=160&view=rev
Author: mlampard
Date: 2006-11-16 03:11:45 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
increase compiler verbosity, remove unused vars and other cruftiness
Modified Paths:
--------------
trunk/g15daemon-wip/g15daemon/Makefile.am
trunk/g15daemon-wip/g15daemon/g15_plugins.c
trunk/g15daemon-wip/g15daemon/g15daemon.h
trunk/g15daemon-wip/g15daemon/lcdclient_test.c
trunk/g15daemon-wip/g15daemon/linked_lists.c
trunk/g15daemon-wip/g15daemon/main.c
trunk/g15daemon-wip/g15daemon/utility_funcs.c
trunk/g15daemon-wip/g15daemon_xmms/Makefile.am
trunk/g15daemon-wip/g15daemon_xmms/g15daemon_xmms_spectrum.c
trunk/g15daemon-wip/plugins/Makefile.am
trunk/g15daemon-wip/plugins/g15_plugin_clock.c
trunk/g15daemon-wip/plugins/g15_plugin_net.c
Modified: trunk/g15daemon-wip/g15daemon/Makefile.am
===================================================================
--- trunk/g15daemon-wip/g15daemon/Makefile.am 2006-11-16 09:52:02 UTC (rev 159)
+++ trunk/g15daemon-wip/g15daemon/Makefile.am 2006-11-16 11:11:45 UTC (rev 160)
@@ -1,6 +1,6 @@
METASOURCES = AUTO
-AM_CFLAGS = -DG15DAEMON_BUILD
+AM_CFLAGS = -DG15DAEMON_BUILD -Wall
sbin_PROGRAMS = g15daemon
noinst_PROGRAMS = g15daemontest
noinst_HEADERS = g15logo.h
Modified: trunk/g15daemon-wip/g15daemon/g15_plugins.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/g15_plugins.c 2006-11-16 09:52:02 UTC (rev 159)
+++ trunk/g15daemon-wip/g15daemon/g15_plugins.c 2006-11-16 11:11:45 UTC (rev 160)
@@ -68,6 +68,7 @@
int g15daemon_dlclose_plugin(void *handle) {
dlclose(handle);
+ return 0;
}
void run_lcd_client(plugin_t *plugin_args) {
@@ -139,7 +140,7 @@
void *plugin_thread(plugin_t *plugin_args) {
plugin_info_t *info = plugin_args->info;
- int (*event)(plugin_event_t *event) = (void*)plugin_args->info->event_handler;
+ /* int (*event)(plugin_event_t *event) = (void*)plugin_args->info->event_handler; */
void *handle = plugin_args->plugin_handle;
if(plugin_args->info->plugin_run!=NULL||plugin_args->info->event_handler!=NULL) {
@@ -161,6 +162,7 @@
g15daemon_log(LOG_INFO,"Removed plugin %s",info->name);
g15daemon_dlclose_plugin(handle);
+ return NULL;
}
int g15_plugin_load (lcdlist_t **displaylist, char *name) {
@@ -182,7 +184,7 @@
g15daemon_log(LOG_ERR,"%s is not a valid g15daemon plugin\n",name);
g15daemon_dlclose_plugin(plugin_handle);
dlerror();
- return;
+ return -1;
}
plugin_args->type = plugin_args->info->type;
@@ -221,6 +223,7 @@
pthread_detach(client_connection);
}
}
+ return 0;
}
@@ -232,7 +235,7 @@
directory = opendir (plugin_directory);
if (directory != NULL)
{
- while (ep = readdir (directory)) {
+ while ((ep = readdir (directory))) {
if(strstr(ep->d_name,".so")){
strcpy(pluginname, plugin_directory);
strncat(pluginname,"/",1);
Modified: trunk/g15daemon-wip/g15daemon/g15daemon.h
===================================================================
--- trunk/g15daemon-wip/g15daemon/g15daemon.h 2006-11-16 09:52:02 UTC (rev 159)
+++ trunk/g15daemon-wip/g15daemon/g15daemon.h 2006-11-16 11:11:45 UTC (rev 160)
@@ -172,7 +172,7 @@
lcdnode_t *current;
void *(*keyboard_handler)(void*);
struct passwd *nobody;
- unsigned long numclients;
+ volatile unsigned long numclients;
}lcdlist_s;
pthread_mutex_t lcdlist_mutex;
@@ -184,7 +184,12 @@
#ifdef G15DAEMON_BUILD
/* internal g15daemon-only functions */
void uf_write_buf_to_g15(lcd_t *lcd);
-
+/* return the pid of a running copy of g15daemon, else -1 */
+int uf_return_running();
+/* create a /var/run/g15daemon.pid file, returning 0 on success else -1 */
+int uf_create_pidfile();
+/* open & run all plugins in the given directory */
+void g15_open_all_plugins(lcdlist_t **displaylist, char *plugin_directory);
/* linked lists */
lcdlist_t *ll_lcdlist_init();
void ll_lcdlist_destroy(lcdlist_t **displaylist);
@@ -204,7 +209,7 @@
/* syslog wrapper */
int g15daemon_log (int priority, const char *fmt, ...);
/* cycle from displayed screen to next on list */
-int g15daemon_lcdnode_cycle(lcdlist_t *displaylist);
+void g15daemon_lcdnode_cycle(lcdlist_t *displaylist);
/* add new screen */
lcdnode_t *g15daemon_lcdnode_add(lcdlist_t **displaylist) ;
/* remove screen */
Modified: trunk/g15daemon-wip/g15daemon/lcdclient_test.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/lcdclient_test.c 2006-11-16 09:52:02 UTC (rev 159)
+++ trunk/g15daemon-wip/g15daemon/lcdclient_test.c 2006-11-16 11:11:45 UTC (rev 160)
@@ -64,7 +64,7 @@
retval = g15_send(g15screen_fd,(char*)lcdbuffer,6880);
}
- printf("checking key status - press G1 to exit\n",retval);
+ printf("checking key status - press G1 to exit\n");
while(1){
keystate = 0;
Modified: trunk/g15daemon-wip/g15daemon/linked_lists.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/linked_lists.c 2006-11-16 09:52:02 UTC (rev 159)
+++ trunk/g15daemon-wip/g15daemon/linked_lists.c 2006-11-16 11:11:45 UTC (rev 160)
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <pthread.h>
#include <g15daemon.h>
#include <libg15.h>
@@ -113,7 +114,7 @@
}
/* cycle through connected client displays */
-int g15daemon_lcdnode_cycle(lcdlist_t *displaylist)
+void g15daemon_lcdnode_cycle(lcdlist_t *displaylist)
{
lcdnode_t *current_screen = displaylist->current;
@@ -159,7 +160,7 @@
next = &oldnode->next;
ll_quit_lcd(oldnode->lcd);
- (unsigned int)(*displaylist)->numclients--;
+ (*displaylist)->numclients--;
if((*displaylist)->current == oldnode) {
if((*displaylist)->current!=(*displaylist)->head){
(*displaylist)->current = oldnode->next;
Modified: trunk/g15daemon-wip/g15daemon/main.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/main.c 2006-11-16 09:52:02 UTC (rev 159)
+++ trunk/g15daemon-wip/g15daemon/main.c 2006-11-16 11:11:45 UTC (rev 160)
@@ -144,6 +144,7 @@
(*plugin_listener)((void*)newevent);
}
}
+ return 0;
}
static void *keyboard_watch_thread(void *lcdlist){
@@ -274,7 +275,7 @@
if (!strncmp(daemonargs, "-u",2) || !strncmp(daemonargs, "--user",7)) {
if(argv[i+1]!=NULL){
- strncpy(user,argv[i+1],128);
+ strncpy((char*)user,argv[i+1],128);
i++;
}
}
@@ -289,18 +290,16 @@
if(uf_create_pidfile() == 0) {
- int fd;
- fd_set fds;
lcdlist_t *lcdlist;
pthread_attr_t attr;
struct passwd *nobody;
unsigned char location[1024];
openlog("g15daemon", LOG_PID, LOG_DAEMON);
- if(strlen(user)==0){
+ if(strlen((char*)user)==0){
nobody = getpwnam("nobody");
}else {
- nobody = getpwnam(user);
+ nobody = getpwnam((char*)user);
}
if (nobody==NULL)
{
@@ -350,20 +349,20 @@
}
g15daemon_log(LOG_INFO,"%s loaded\n",PACKAGE_STRING);
- snprintf(location,1024,"%s/%s\0",DATADIR,"g15daemon/splash/g15logo2.wbmp");
+ snprintf((char*)location,1024,"%s/%s",DATADIR,"g15daemon/splash/g15logo2.wbmp");
g15canvas *canvas = (g15canvas *)malloc (sizeof (g15canvas));
memset (canvas->buffer, 0, G15_BUFFER_LEN);
canvas->mode_cache = 0;
canvas->mode_reverse = 0;
canvas->mode_xor = 0;
- g15r_loadWbmpSplash(canvas,location);
+ g15r_loadWbmpSplash(canvas,(char*)location);
memcpy (lcdlist->tail->lcd->buf, canvas->buffer, G15_BUFFER_LEN);
free (canvas);
uf_write_buf_to_g15(lcdlist->tail->lcd);
- snprintf(location,1024,"%s/%s\0",DATADIR,"g15daemon/plugins");
+ snprintf((char*)location,1024,"%s/%s",DATADIR,"g15daemon/plugins");
- g15_open_all_plugins(lcdlist,location);
+ g15_open_all_plugins(lcdlist,(char*)location);
new_action.sa_handler = g15daemon_sighandler;
new_action.sa_flags = 0;
Modified: trunk/g15daemon-wip/g15daemon/utility_funcs.c
===================================================================
--- trunk/g15daemon-wip/g15daemon/utility_funcs.c 2006-11-16 09:52:02 UTC (rev 159)
+++ trunk/g15daemon-wip/g15daemon/utility_funcs.c 2006-11-16 11:11:45 UTC (rev 160)
@@ -31,11 +31,10 @@
#include <errno.h>
#include <string.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
-#include <poll.h>
-#include <sys/socket.h>
+#include <sys/time.h>
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -132,7 +131,6 @@
/* syslog wrapper */
int g15daemon_log (int priority, const char *fmt, ...) {
- unsigned char buf[1024];
va_list argp;
va_start (argp, fmt);
if(g15daemon_debug == 0)
Modified: trunk/g15daemon-wip/g15daemon_xmms/Makefile.am
===================================================================
--- trunk/g15daemon-wip/g15daemon_xmms/Makefile.am 2006-11-16 09:52:02 UTC (rev 159)
+++ trunk/g15daemon-wip/g15daemon_xmms/Makefile.am 2006-11-16 11:11:45 UTC (rev 160)
@@ -5,7 +5,7 @@
endif
libdir = @XMMS_VISUALIZATION_PLUGIN_DIR@
-AM_CFLAGS = -Wall @XMMS_CFLAGS@ @CFLAGS@ -I$(top_builddir) -I$(top_srcdir) \
+AM_CFLAGS = -O3 -Wall @XMMS_CFLAGS@ @CFLAGS@ -I$(top_builddir) -I$(top_srcdir) \
@GTK_CFLAGS@
LIBS = @XMMS_LIBS@ -L$(top_builddir)/libg15daemon_client/
Modified: trunk/g15daemon-wip/g15daemon_xmms/g15daemon_xmms_spectrum.c
===================================================================
--- trunk/g15daemon-wip/g15daemon_xmms/g15daemon_xmms_spectrum.c 2006-11-16 09:52:02 UTC (rev 159)
+++ trunk/g15daemon-wip/g15daemon_xmms/g15daemon_xmms_spectrum.c 2006-11-16 11:11:45 UTC (rev 160)
@@ -20,9 +20,10 @@
This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients.
Client screens can be cycled through by pressing the 'L1' key.
+
+ simple analyser xmms plugin for g15daemon
*/
-/* xmms plugin for the daemon, based on finespectrum plugin available on sourceforge */
#include <stdlib.h>
#include <unistd.h>
#include <g15daemon_client.h>
@@ -35,26 +36,10 @@
#include <xmms/xmmsctrl.h>
#include <libg15render.h>
-#define WIDTH 256
-
-/* Linearity of the amplitude scale (0.5 for linear, keep in [0.1, 0.9]) */
-//#define linearity 0.33
-#define linearity 0.33
-
#define NUM_BANDS 16
-/* Time factor of the band dinamics. 3 means that the coefficient of the
-last value is half of the current one's. (see source) */
-#define tau 3
+static gint16 bar_heights[NUM_BANDS];
-/* Factor used for the diffusion. 4 means that half of the height is
-added to the neighbouring bars */
-#define dif 4
-
-static gint16 bar_heights[WIDTH];
-
-static gdouble scale, x00, y00;
-
static void g15analyser_init(void);
static void g15analyser_cleanup(void);
static void g15analyser_playback_start(void);
@@ -171,10 +156,6 @@
canvas->mode_xor = 0;
}
- scale = G15_HEIGHT / ( log((1 - linearity) / linearity) *2 );
- x00 = linearity*linearity*32768.0/(2 * linearity - 1);
- y00 = -log(-x00) * scale;
-
leaving = 0;
pthread_mutex_unlock(&g15buf_mutex);
Modified: trunk/g15daemon-wip/plugins/Makefile.am
===================================================================
--- trunk/g15daemon-wip/plugins/Makefile.am 2006-11-16 09:52:02 UTC (rev 159)
+++ trunk/g15daemon-wip/plugins/Makefile.am 2006-11-16 11:11:45 UTC (rev 160)
@@ -1,6 +1,7 @@
METASOURCES = AUTO
libdir = /usr/share/g15daemon/plugins
+AM_CFLAGS = -Wall
lib_LTLIBRARIES =g15plugin_uinput.la g15plugin_tcpserver.la g15plugin_clock.la
INCLUDES = -I$(top_builddir)/libg15daemon_client/ -I$(top_builddir)/g15daemon
Modified: trunk/g15daemon-wip/plugins/g15_plugin_clock.c
===================================================================
--- trunk/g15daemon-wip/plugins/g15_plugin_clock.c 2006-11-16 09:52:02 UTC (rev 159)
+++ trunk/g15daemon-wip/plugins/g15_plugin_clock.c 2006-11-16 11:11:45 UTC (rev 160)
@@ -99,10 +99,12 @@
/* completely uncessary function called when plugin is exiting */
static void *callmewhenimdone(lcd_t *lcd){
+ return NULL;
}
/* completely unnecessary initialisation function which could just as easily have been set to NULL in the g15plugin_info struct */
static void *myinithandler(lcd_t *lcd){
+ return NULL;
}
/* if no exitfunc or eventhandler, member should be NULL */
Modified: trunk/g15daemon-wip/plugins/g15_plugin_net.c
===================================================================
--- trunk/g15daemon-wip/plugins/g15_plugin_net.c 2006-11-16 09:52:02 UTC (rev 159)
+++ trunk/g15daemon-wip/plugins/g15_plugin_net.c 2006-11-16 11:11:45 UTC (rev 160)
@@ -26,6 +26,7 @@
#include <pthread.h>
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -58,8 +59,8 @@
static void process_client_cmds(lcdnode_t *lcdnode, int sock, unsigned int *msgbuf, unsigned int len)
{
- int msgret;
-/* if(msgbuf[0] == CLIENT_CMD_GET_KEYSTATE)
+ /* int msgret;
+ if(msgbuf[0] == CLIENT_CMD_GET_KEYSTATE)
{ // client wants keypresses - FIXME this is redundant with the new event based architecture
if(lcdnode->list->current == lcdnode){
// send the keystate inband back to the client
@@ -232,7 +233,6 @@
lcdnode_t *g15node = display;
lcd_t *client_lcd = g15node->lcd;
int retval;
- int i,y,x;
unsigned int width, height, buflen,header=4;
int client_sock = client_lcd->connection;
@@ -389,7 +389,7 @@
/* incoming events */
int server_events(plugin_event_t *event) {
lcd_t *lcd = (lcd_t*) event->lcd;
- static int lastkeys;
+
switch (event->event)
{
case G15_EVENT_KEYPRESS:{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|