Use compiler flag -Wall. Cleanup code as necessary.

(#171 Thanks to Rolf Ahrenberg)
Modified Files:
	Makefile streamdev-server.c server/connection.h
	server/connectionHTTP.c server/connectionVTP.c tools/source.c
This commit is contained in:
schmirl 2007-04-16 11:01:02 +00:00
parent 69b754bef9
commit 3ceb716ea9
6 changed files with 13 additions and 15 deletions

View File

@ -1,7 +1,7 @@
# #
# Makefile for a Video Disk Recorder plugin # Makefile for a Video Disk Recorder plugin
# #
# $Id: Makefile,v 1.7 2006/09/14 10:30:16 schmirl Exp $ # $Id: Makefile,v 1.8 2007/04/16 11:01:02 schmirl Exp $
# The official name of this plugin. # The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin. # This name will be used in the '-P...' option of VDR to load the plugin.
@ -16,7 +16,7 @@ VERSION = $(shell grep 'const char \*VERSION *=' common.c | awk '{ print $$5 }'
### The C++ compiler and options: ### The C++ compiler and options:
CXX ?= g++ CXX ?= g++
CXXFLAGS ?= -fPIC -W -Woverloaded-virtual CXXFLAGS ?= -fPIC -Wall -Woverloaded-virtual
### The directory environment: ### The directory environment:

View File

@ -1,5 +1,5 @@
/* /*
* $Id: connection.h,v 1.4 2007/04/02 10:32:34 schmirl Exp $ * $Id: connection.h,v 1.5 2007/04/16 11:01:02 schmirl Exp $
*/ */
#ifndef VDR_STREAMDEV_SERVER_CONNECTION_H #ifndef VDR_STREAMDEV_SERVER_CONNECTION_H
@ -38,8 +38,8 @@ protected:
Only one line at a time may be sent. If there are lines to follow, set Only one line at a time may be sent. If there are lines to follow, set
Last to false. Command(NULL) will be called in the next cycle, so you can Last to false. Command(NULL) will be called in the next cycle, so you can
post the next line. */ post the next line. */
virtual bool Respond(const char *Message, bool Last = true, ...) virtual bool Respond(const char *Message, bool Last = true, ...);
__attribute__ ((format (printf, 2, 4))); //__attribute__ ((format (printf, 2, 4)));
public: public:
/* If you derive, specify a short string such as HTTP for Protocol, which /* If you derive, specify a short string such as HTTP for Protocol, which

View File

@ -1,5 +1,5 @@
/* /*
* $Id: connectionHTTP.c,v 1.10 2006/01/26 19:40:18 lordjaxom Exp $ * $Id: connectionHTTP.c,v 1.11 2007/04/16 11:01:02 schmirl Exp $
*/ */
#include <ctype.h> #include <ctype.h>
@ -41,6 +41,8 @@ bool cConnectionHTTP::Command(char *Cmd)
} }
Dprintf("header\n"); Dprintf("header\n");
return true; return true;
default:
break;
} }
return false; // ??? shouldn't happen return false; // ??? shouldn't happen
} }
@ -153,7 +155,7 @@ bool cConnectionHTTP::CmdGET(const std::string &Opts)
{ {
const char *sp = Opts.c_str(), *ptr = sp, *ep; const char *sp = Opts.c_str(), *ptr = sp, *ep;
const cChannel *chan; const cChannel *chan;
int apid = 0, pos; int apid = 0;
ptr = skipspace(ptr); ptr = skipspace(ptr);
while (*ptr == '/') while (*ptr == '/')

View File

@ -1,5 +1,5 @@
/* /*
* $Id: connectionVTP.c,v 1.8 2007/03/02 15:27:07 schmirl Exp $ * $Id: connectionVTP.c,v 1.9 2007/04/16 11:01:02 schmirl Exp $
*/ */
#include "server/connectionVTP.h" #include "server/connectionVTP.h"
@ -153,8 +153,6 @@ cLSTEHandler::~cLSTEHandler()
bool cLSTEHandler::Next(bool &Last) bool cLSTEHandler::Next(bool &Last)
{ {
char *buffer;
if (m_Error != NULL) { if (m_Error != NULL) {
Last = true; Last = true;
cString str(m_Error, true); cString str(m_Error, true);
@ -562,8 +560,6 @@ bool cConnectionVTP::Command(char *Cmd)
bool cConnectionVTP::CmdCAPS(char *Opts) bool cConnectionVTP::CmdCAPS(char *Opts)
{ {
char *buffer;
if (strcasecmp(Opts, "TS") == 0) { if (strcasecmp(Opts, "TS") == 0) {
m_NoTSPIDS = true; m_NoTSPIDS = true;
return Respond(220, "Ignored, capability \"%s\" accepted for " return Respond(220, "Ignored, capability \"%s\" accepted for "

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: streamdev-server.c,v 1.5 2007/02/19 12:08:16 schmirl Exp $ * $Id: streamdev-server.c,v 1.6 2007/04/16 11:01:02 schmirl Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -63,7 +63,7 @@ bool cPluginStreamdevServer::Start(void)
if (!StreamdevHosts.Load(STREAMDEVHOSTSPATH, true, true)) { if (!StreamdevHosts.Load(STREAMDEVHOSTSPATH, true, true)) {
esyslog("streamdev-server: error while loading %s", STREAMDEVHOSTSPATH); esyslog("streamdev-server: error while loading %s", STREAMDEVHOSTSPATH);
fprintf(stderr, "streamdev-server: error while loading %s\n"); fprintf(stderr, "streamdev-server: error while loading %s\n", STREAMDEVHOSTSPATH);
if (access(STREAMDEVHOSTSPATH, F_OK) != 0) { if (access(STREAMDEVHOSTSPATH, F_OK) != 0) {
fprintf(stderr, " Please install streamdevhosts.conf into the path " fprintf(stderr, " Please install streamdevhosts.conf into the path "
"printed above. Without it\n" "printed above. Without it\n"

View File

@ -110,7 +110,7 @@ bool cTBSource::SafeWrite(const void *Buffer, size_t Length) {
ssize_t cTBSource::ReadUntil(void *Buffer, size_t Length, const char *Seq, ssize_t cTBSource::ReadUntil(void *Buffer, size_t Length, const char *Seq,
uint TimeoutMs) { uint TimeoutMs) {
int seqlen, ms; int ms;
size_t len; size_t len;
cTBSelect sel; cTBSelect sel;