Fix some warnings that were really errors.

It would really help to fix the remaining warnings so that these
files can be compiled with -Werror, which gets me to the quesiton:
Is this code still maintained in some form or was it an interesting
experiment that has been terminated?

svn path=/trunk/; revision=53406
This commit is contained in:
Jörg Mayer 2013-11-18 07:25:12 +00:00
parent adc82b16ba
commit 7b80faa66f
3 changed files with 7 additions and 14 deletions

View File

@ -223,7 +223,7 @@ static echld_bool_t param_set_cwd(char* val , char** err ) {
static unsigned packet_count = 0;
static char* param_get_packet_count(char** err) {
if (child.state != CAPTURING || child.state != READING) {
if (child.state != CAPTURING && child.state != READING) {
*err = g_strdup("Must be reading or in-capture for packet_count");
return NULL;
}
@ -306,7 +306,7 @@ static int out_file_type = WTAP_FILE_TYPE_SUBTYPE_PCAP;
#endif
static echld_bool_t param_set_out_file_type(char* val, char** err) {
int oft = wtap_short_string_to_file_type(val);
int oft = wtap_short_string_to_file_type_subtype(val);
if (oft < 0) {
*err = g_strdup_printf("\"%s\" isn't a valid capture file type", val);
@ -319,8 +319,8 @@ static echld_bool_t param_set_out_file_type(char* val, char** err) {
static char* param_get_out_file_type(char** err _U_) {
return g_strdup_printf("%s(%d): %s",
wtap_file_type_short_string(out_file_type),
out_file_type, wtap_file_type_string(out_file_type));
wtap_file_type_subtype_short_string(out_file_type),
out_file_type, wtap_file_type_subtype_string(out_file_type));
}
@ -538,7 +538,7 @@ static long child_receive(guint8* b, size_t len, echld_chld_id_t chld_id, echld_
case ECHLD_GET_SUM: {
char* range;
if (child.state != CAPTURING || child.state != READING || child.state != DONE) goto wrong_state;
if (child.state != CAPTURING && child.state != READING && child.state != DONE) goto wrong_state;
if ( child.dec->get_sum(b,len,&range) ) {
child_get_summary(range);

View File

@ -202,7 +202,6 @@ static void dispatcher_err(int errnum, const char* fmt, ...) {
static char* intflist2json(GList* if_list, char** if_cap_err) {
#define ADDRSTRLEN 46 /* Covers IPv4 & IPv6 */
int i;
GList *if_entry;
if_info_t *if_info;
GSList *addr;
@ -212,7 +211,6 @@ static char* intflist2json(GList* if_list, char** if_cap_err) {
GString *str = g_string_new("{ what='interfaces', interfaces={ \n");
char* s;
i = 1; /* Interface id number */
for (if_entry = g_list_first(if_list); if_entry != NULL;
if_entry = g_list_next(if_entry)) {
if_info = (if_info_t *)if_entry->data;
@ -392,7 +390,7 @@ static char* param_get_capture_types(char** err _U_) {
for (i = 0; i < WTAP_NUM_FILE_TYPES_SUBTYPES; i++) {
if (wtap_dump_can_open(i)) {
g_string_append_printf(str,"%s: %s\n",
wtap_file_type_short_string(i), wtap_file_type_string(i));
wtap_file_type_subtype_short_string(i), wtap_file_type_subtype_string(i));
}
}
@ -1025,14 +1023,8 @@ void dispatcher_alrm(int sig _U_) {
void echld_dispatcher_start(int* in_pipe_fds, int* out_pipe_fds, char* argv0, int (*main)(int, char **)) {
static struct dispatcher d;
int i;
#ifdef DEBUG_DISPATCHER
int dbg_fd;
#endif
DISP_DBG_INIT();
#ifdef DEBUG_DISPATCHER
dbg_fd = fileno(debug_fp);
#endif
DISP_DBG((2,"Dispatcher Starting"));

View File

@ -70,6 +70,7 @@
#include "cfile.h"
#include "wsutil/crash_info.h"
#include "wsutil/privileges.h"
#include "wsutil/filesystem.h"
#include "epan/epan.h"
#include "epan/prefs.h"
#include "epan/ex-opt.h"