summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2014-09-07 19:59:08 -0400
committerAllen Winter <allen.winter@kdab.com>2014-09-07 19:59:08 -0400
commitaf1ad47fad1fc91989847bab22d12c3996a040ef (patch)
tree09f4ed9452778c54a8791c4b229f8e24f3af7546
parenta046f246262fcb0c7da33ec1b6958abc0fc56863 (diff)
downloadlibical-git-af1ad47fad1fc91989847bab22d12c3996a040ef.tar.gz
Eliminate many compiler warnings from gcc
-rw-r--r--CMakeLists.txt4
-rw-r--r--examples/errors.c4
-rw-r--r--examples/main.c1
-rw-r--r--examples/parse_text.c6
-rwxr-xr-xscripts/mkrestrictiontable.pl4
-rw-r--r--src/libical/icalattach.c2
-rw-r--r--src/libical/icalparser.c1
-rw-r--r--src/libical/icalrecur.c12
-rw-r--r--src/libical/icalrestriction.c.in36
-rw-r--r--src/libical/icalvalue.c7
-rw-r--r--src/libical/sspm.c5
-rw-r--r--src/libicalss/icalclassify.c36
-rw-r--r--src/libicalss/icaldirset.c37
-rw-r--r--src/libicalss/icalgauge.c2
-rw-r--r--src/libicalss/icalset.c2
-rw-r--r--src/libicalss/icalspanlist.c1
-rw-r--r--src/libicalss/icalssyacc.c6
-rw-r--r--src/libicalvcal/icalvcal.c32
-rw-r--r--src/libicalvcal/vcc.c8
-rw-r--r--src/libicalvcal/vcc.h70
-rw-r--r--src/libicalvcal/vcc.y8
-rw-r--r--src/test/CMakeLists.txt2
-rw-r--r--src/test/copycluster.c1
-rw-r--r--src/test/icaltestparser.c2
-rw-r--r--src/test/process.c10
-rw-r--r--src/test/recur.c7
-rw-r--r--src/test/regression-recur.c4
-rw-r--r--src/test/regression-storage.c8
-rw-r--r--src/test/regression.h6
-rw-r--r--src/test/stow.c9
-rw-r--r--src/test/timezones.c2
31 files changed, 166 insertions, 169 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 911b72f3..351b1353 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -207,7 +207,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
check_c_compiler_flag(-Wunused-but-set-variable HAVE_GCC_UNUSED_BUT_SET)
check_c_compiler_flag(-Wlogical-op HAVE_GCC_LOGICAL_OP)
check_c_compiler_flag(-Wsizeof-pointer-memaccess HAVE_GCC_POINTER_MEMACCESS)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated -Wall -Wextra -Winit-self -Wmissing-include-dirs -Wunused -Wno-div-by-zero -Wundef -Wpointer-arith -Wcast-qual -Wcast-align -Wmissing-noreturn -Werror=return-type")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated -Wall -Wextra -Winit-self -Wmissing-include-dirs -Wunused -Wno-div-by-zero -Wundef -Wpointer-arith -Wcast-align -Werror=return-type")
if(HAVE_GCC_UNUSED_BUT_SET)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused-but-set-variable")
endif()
@@ -224,7 +224,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
check_cxx_compiler_flag(-Wunused-but-set-variable HAVE_GCC_UNUSED_BUT_SET)
check_cxx_compiler_flag(-Wlogical-op HAVE_GCC_LOGICAL_OP)
check_cxx_compiler_flag(-Wsizeof-pointer-memaccess HAVE_GCC_POINTER_MEMACCESS)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wall -Wextra -Woverloaded-virtual -Winit-self -Wmissing-include-dirs -Wunused -Wno-div-by-zero -Wundef -Wpointer-arith -Wcast-qual -Wcast-align -Wmissing-noreturn -Werror=return-type")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wall -Wextra -Woverloaded-virtual -Winit-self -Wmissing-include-dirs -Wunused -Wno-div-by-zero -Wundef -Wpointer-arith -Wcast-align -Werror=return-type")
if(HAVE_GCC_UNUSED_BUT_SET)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-but-set-variable")
endif()
diff --git a/examples/errors.c b/examples/errors.c
index 2ff316dd..0072f144 100644
--- a/examples/errors.c
+++ b/examples/errors.c
@@ -8,11 +8,9 @@ void program_errors()
/*Most routines will set icalerrno on errors. This is an
enumeration defined in icalerror.h */
- icalcomponent *c;
-
icalerror_clear_errno();
- c = icalcomponent_new(ICAL_VEVENT_COMPONENT);
+ (void)icalcomponent_new(ICAL_VEVENT_COMPONENT);
if (icalerrno != ICAL_NO_ERROR){
diff --git a/examples/main.c b/examples/main.c
index 3d8d7777..26725eaf 100644
--- a/examples/main.c
+++ b/examples/main.c
@@ -9,4 +9,5 @@ int main()
void do_something(icalcomponent* comp){
+ (void)comp;/*unused*/
}
diff --git a/examples/parse_text.c b/examples/parse_text.c
index 2fc9051b..75f88f2c 100644
--- a/examples/parse_text.c
+++ b/examples/parse_text.c
@@ -19,14 +19,12 @@ files, sockets, etc. */
char* read_stream(char *s, size_t size, void *d)
{
- char *c = fgets(s,size, (FILE*)d);
-
- return c;
-
+ return fgets(s, (int)size, (FILE*)d);
}
void parse_text(int argc, char* argv[])
{
+ (void)argc;/*unused*/
char* line;
FILE* stream;
diff --git a/scripts/mkrestrictiontable.pl b/scripts/mkrestrictiontable.pl
index 101e8b7c..d47f3ffd 100755
--- a/scripts/mkrestrictiontable.pl
+++ b/scripts/mkrestrictiontable.pl
@@ -60,7 +60,7 @@ while(<F>)
# Print the terminating line
-print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_RESTRICTION_NONE}\n";
+print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_RESTRICTION_NONE,0}\n";
print "};\n";
@@ -96,7 +96,7 @@ while(<F>)
}
# print the terminating line
-print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_COMPONENT,ICAL_RESTRICTION_NONE}\n";
+print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_COMPONENT,ICAL_RESTRICTION_NONE,0}\n";
print "};\n";
}
diff --git a/src/libical/icalattach.c b/src/libical/icalattach.c
index 6c6ff070..11c0a7f8 100644
--- a/src/libical/icalattach.c
+++ b/src/libical/icalattach.c
@@ -147,5 +147,5 @@ icalattach_get_data (icalattach *attach)
icalerror_check_arg_rz ((attach != NULL), "attach");
icalerror_check_arg_rz ((!attach->is_url), "!attach->is_url");
- return attach->u.data.data;
+ return (unsigned char *)attach->u.data.data;
}
diff --git a/src/libical/icalparser.c b/src/libical/icalparser.c
index 84773835..65f6efff 100644
--- a/src/libical/icalparser.c
+++ b/src/libical/icalparser.c
@@ -317,6 +317,7 @@ char* parser_get_next_paramvalue(char* line, char **end)
char* icalparser_get_value(char* line, char **end, icalvalue_kind kind)
{
+ (void)kind;/*unused*/
char *str;
size_t length = strlen(line);
diff --git a/src/libical/icalrecur.c b/src/libical/icalrecur.c
index 74f2c4da..85ee8b1c 100644
--- a/src/libical/icalrecur.c
+++ b/src/libical/icalrecur.c
@@ -285,6 +285,7 @@ void icalrecur_clause_name_and_value(struct icalrecur_parser *parser,
void icalrecur_add_byrules(struct icalrecur_parser *parser, short *array,
int size, char* vals)
{
+ (void)parser;/*unused*/
char *t, *n;
int i=0;
int sign = 1;
@@ -370,12 +371,9 @@ void icalrecur_add_bydayrules(struct icalrecur_parser *parser, const char* vals)
char weekno = 0; /* note: Novell/Groupwise sends BYDAY=255SU, so we fit in a signed char to get -1 SU for last sunday. */
icalrecurrencetype_weekday wd;
short *array = parser->rt.by_day;
- char* end;
char* vals_copy;
vals_copy = icalmemory_strdup(vals);
-
- end = (char*)vals_copy+strlen(vals_copy);
n = vals_copy;
while(n != 0){
@@ -1807,7 +1805,6 @@ static int next_week(icalrecur_iterator* impl)
/*FREQ=WEEKLY;BYWEEK=20*/
/* Use the Week Number byrule data */
int week_no;
- struct icaltimetype t;
impl->by_indices[BY_WEEK_NO]++;
@@ -1818,10 +1815,6 @@ static int next_week(icalrecur_iterator* impl)
end_of_data = 1;
}
- t = impl->last;
- t.month=1; /* HACK, should be setting to the date of the first week of year*/
- t.day=1;
-
week_no = impl->by_ptrs[BY_WEEK_NO][impl->by_indices[BY_WEEK_NO]];
impl->last.day += week_no*7;
@@ -2061,7 +2054,7 @@ static int expand_year_days(icalrecur_iterator* impl, int year)
case 1<<BY_WEEK_NO: {
/* FREQ=YEARLY; BYWEEKNO=20,50 */
-
+#if 0 /*unfinished*/
int dow;
t.day = impl->dtstart.day;
@@ -2070,6 +2063,7 @@ static int expand_year_days(icalrecur_iterator* impl, int year)
t.is_date = 1;
dow = icaltime_day_of_week(t);
+#endif
/* HACK Not finished */
icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR);
diff --git a/src/libical/icalrestriction.c.in b/src/libical/icalrestriction.c.in
index d8c03ccc..e08e1db0 100644
--- a/src/libical/icalrestriction.c.in
+++ b/src/libical/icalrestriction.c.in
@@ -63,10 +63,6 @@ static const icalrestriction_property_record*
icalrestriction_get_property_restriction(icalproperty_method method,
icalcomponent_kind component,
icalproperty_kind property);
-static const icalrestriction_component_record*
-icalrestriction_get_component_restriction(icalproperty_method method,
- icalcomponent_kind component,
- icalcomponent_kind subcomponent);
icalrestriction_property_record null_prop_record = {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_RESTRICTION_UNKNOWN,0};
icalrestriction_component_record null_comp_record = {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_COMPONENT,ICAL_RESTRICTION_UNKNOWN,0};
@@ -239,10 +235,9 @@ const char* icalrestriction_must_be_recurring(
const icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
- /* Hack */
- (void)rec;
- (void)comp;
- (void)prop;
+ (void)rec; /*unused*/
+ (void)comp;/*unused*/
+ (void)prop;/*unused*/
return 0;
}
@@ -251,6 +246,8 @@ const char* icalrestriction_must_have_duration(
icalcomponent* comp,
icalproperty* prop)
{
+ (void)rec;/*unused*/
+ (void)prop;/*unused*/
if( !icalcomponent_get_first_property(comp,ICAL_DURATION_PROPERTY)){
return "Failed iTIP restrictions for DURATION property. This component must have a DURATION property";
@@ -495,26 +492,3 @@ icalrestriction_get_property_restriction(icalproperty_method method,
return &null_prop_record;
}
-
-
-static const icalrestriction_component_record*
-icalrestriction_get_component_restriction(icalproperty_method method,
- icalcomponent_kind component,
- icalcomponent_kind subcomponent)
-{
-
- int i;
-
- for(i = 0;
- icalrestriction_component_records[i].restriction != ICAL_RESTRICTION_NONE;
- i++){
-
- if (method == icalrestriction_component_records[i].method &&
- component == icalrestriction_component_records[i].component &&
- subcomponent == icalrestriction_component_records[i].subcomponent ){
- return &icalrestriction_component_records[i];
- }
- }
-
- return &null_comp_record;
-}
diff --git a/src/libical/icalvalue.c b/src/libical/icalvalue.c
index 8b31650c..311be9bb 100644
--- a/src/libical/icalvalue.c
+++ b/src/libical/icalvalue.c
@@ -55,10 +55,6 @@
#define strcasecmp stricmp
#endif
-#if _MAC_OS_
-#include "icalmemory_strdup.h"
-#endif
-
#define TMP_BUF_SIZE 1024
void print_datetime_to_string(char* str, const struct icaltimetype *data);
@@ -868,12 +864,9 @@ icalvalue_is_valid (const icalvalue* value)
static char* icalvalue_binary_as_ical_string_r(const icalvalue* value) {
- const char* data;
char* str;
icalerror_check_arg_rz( (value!=0),"value");
- data = icalvalue_get_binary(value);
-
str = (char*)icalmemory_new_buffer(60);
snprintf(str, 60,"icalvalue_binary_as_ical_string is not implemented yet");
diff --git a/src/libical/sspm.c b/src/libical/sspm.c
index 64790900..9189bbc0 100644
--- a/src/libical/sspm.c
+++ b/src/libical/sspm.c
@@ -972,7 +972,7 @@ void sspm_read_header(struct mime_impl *impl,struct sspm_header *header)
}
case HEADER_CONTINUATION: {
- char* last_line, *end;
+ char* last_line;
char *buf_start;
if(current_line < 0){
@@ -983,9 +983,6 @@ void sspm_read_header(struct mime_impl *impl,struct sspm_header *header)
}
last_line = header_lines[current_line];
- end = (char*) ( (size_t)strlen(last_line)+
- (size_t)last_line);
-
impl->state = IN_HEADER;
diff --git a/src/libicalss/icalclassify.c b/src/libicalss/icalclassify.c
index 50dc1b5d..94268aee 100644
--- a/src/libicalss/icalclassify.c
+++ b/src/libicalss/icalclassify.c
@@ -472,15 +472,14 @@ int icalclassify_request_new_organizer(
struct icalclassify_parts *match,
const char* user)
{
+ (void)comp;/*unused*/
+ (void)match;/*unused*/
+ (void)user;/*unused*/
+
/* Organizer has changed between match and component */
icalclassify_pre
icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR);
icalclassify_post
-/* already done before.
- (void)comp;
- (void)match;
- (void)user;
-*/
}
int icalclassify_request_status(
@@ -488,14 +487,13 @@ int icalclassify_request_status(
struct icalclassify_parts *match,
const char* user)
{
+ (void)comp;/*unused*/
+ (void)match;/*unused*/
+ (void)user;/*unused*/
+
icalclassify_pre
icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR);
icalclassify_post
-/*
- (void)comp;
- (void)match;
- (void)user;
-*/
}
int icalclassify_request_forward(
@@ -503,14 +501,13 @@ int icalclassify_request_forward(
struct icalclassify_parts *match,
const char* user)
{
+ (void)comp;/*unused*/
+ (void)match;/*unused*/
+ (void)user;/*unused*/
+
icalclassify_pre
icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR);
icalclassify_post
-/*
- (void)comp;
- (void)match;
- (void)user;
-*/
}
int icalclassify_request_freebusy(
@@ -518,14 +515,13 @@ int icalclassify_request_freebusy(
struct icalclassify_parts *match,
const char* user)
{
+ (void)comp;/*unused*/
+ (void)match;/*unused*/
+ (void)user;/*unused*/
+
icalclassify_pre
icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR);
icalclassify_post
-/*
- (void)comp;
- (void)match;
- (void)user;
-*/
}
int icalclassify_reply_accept(
diff --git a/src/libicalss/icaldirset.c b/src/libicalss/icaldirset.c
index 852206f1..688c9f5e 100644
--- a/src/libicalss/icaldirset.c
+++ b/src/libicalss/icaldirset.c
@@ -129,11 +129,12 @@ icalerrorenum icaldirset_commit(icalset* set)
void icaldirset_lock(const char* dir)
{
+ (void)dir;/*unused*/
}
-
void icaldirset_unlock(const char* dir)
{
+ (void)dir;/*unused*/
}
/* Load the contents of the store directory into the store's internal directory list*/
@@ -557,21 +558,25 @@ icalerrorenum icaldirset_remove_component(icalset* set, icalcomponent* comp)
int icaldirset_count_components(icalset* store,
icalcomponent_kind kind)
{
+ (void)store;/*unused*/
+ (void)kind;/*unused*/
+
/* HACK, not implemented */
assert(0);
return 0;
}
-
icalcomponent* icaldirset_fetch_match(icalset* set, icalcomponent *c)
{
+ (void)set;/*unused*/
+ (void)c;/*unused*/
+
fprintf(stderr," icaldirset_fetch_match is not implemented\n");
assert(0);
return 0;
}
-
icalcomponent* icaldirset_fetch(icalset* set, const char* uid)
{
icaldirset *dset = (icaldirset*)set;
@@ -599,7 +604,6 @@ icalcomponent* icaldirset_fetch(icalset* set, const char* uid)
return c;
}
-
int icaldirset_has_uid(icalset* set, const char* uid)
{
icalcomponent *c;
@@ -616,32 +620,33 @@ int icaldirset_has_uid(icalset* set, const char* uid)
}
-
icalerrorenum icaldirset_select(icalset* set, icalgauge* gauge)
{
- icaldirset *dset = (icaldirset*)set;
+ icaldirset *dset = (icaldirset*)set;
- icalerror_check_arg_re( (set!=0), "set",ICAL_BADARG_ERROR);
+ icalerror_check_arg_re( (set!=0), "set",ICAL_BADARG_ERROR);
icalerror_check_arg_re( (gauge!=0), "gauge",ICAL_BADARG_ERROR);
- dset->gauge = gauge;
+ dset->gauge = gauge;
return ICAL_NO_ERROR;
}
-
icalerrorenum icaldirset_modify(icalset* set,
icalcomponent *old,
icalcomponent *new)
{
+ (void)set;/*unused*/
+ (void)old;/*unused*/
+ (void)new;/*unused*/
+
assert(0);
return ICAL_NO_ERROR; /* HACK, not implemented */
-
}
-
void icaldirset_clear(icalset* set)
{
+ (void)set;/*unused*/
assert(0);
return;
@@ -779,6 +784,7 @@ icalcomponent* icaldirset_get_next_component(icalset* set)
icalsetiter icaldirset_begin_component(icalset* set, icalcomponent_kind kind, icalgauge* gauge)
{
+/*
icalsetiter itr = icalsetiter_null;
icaldirset *fset = (icaldirset*) set;
@@ -786,19 +792,26 @@ icalsetiter icaldirset_begin_component(icalset* set, icalcomponent_kind kind, ic
itr.iter.kind = kind;
itr.gauge = gauge;
-
+*/
/* TO BE IMPLEMENTED */
+ (void)set;/*unused*/
+ (void)kind;/*unused*/
+ (void)gauge;/*unused*/
return icalsetiter_null;
}
icalcomponent* icaldirsetiter_to_next(icalset* set, icalsetiter* i)
{
/* TO BE IMPLEMENTED */
+ (void)set;/*unused*/
+ (void)i;/*unused*/
return NULL;
}
icalcomponent* icaldirsetiter_to_prior(icalset* set, icalsetiter* i)
{
/* TO BE IMPLEMENTED */
+ (void)set;/*unused*/
+ (void)i;/*unused*/
return NULL;
}
diff --git a/src/libicalss/icalgauge.c b/src/libicalss/icalgauge.c
index 64ef1aea..703e7194 100644
--- a/src/libicalss/icalgauge.c
+++ b/src/libicalss/icalgauge.c
@@ -185,7 +185,7 @@ int icalgauge_compare_recurse(icalcomponent* comp, icalcomponent* gauge)
icalproperty* targetprop;
icalparameter* compareparam;
icalparameter_xliccomparetype compare;
- int rel; /* The relationship between the gauge and target values.*/
+ icalparameter_xliccomparetype rel; /* The relationship between the gauge and target values.*/
/* Extract the comparison type from the gauge. If there is no
comparison type, assume that it is "EQUAL" */
diff --git a/src/libicalss/icalset.c b/src/libicalss/icalset.c
index cd38033b..be1561b2 100644
--- a/src/libicalss/icalset.c
+++ b/src/libicalss/icalset.c
@@ -437,7 +437,7 @@ icalcomponent* icalset_get_next_component(icalset* set) {
return set->get_next_component(set);
}
-icalsetiter icalsetiter_null = {{ICAL_NO_COMPONENT, 0}, 0};
+icalsetiter icalsetiter_null = {{ICAL_NO_COMPONENT, 0}, 0, 0, 0, 0};
icalsetiter icalset_begin_component(icalset* set,
icalcomponent_kind kind, icalgauge* gauge) {
diff --git a/src/libicalss/icalspanlist.c b/src/libicalss/icalspanlist.c
index 456abb15..f1cc1fb6 100644
--- a/src/libicalss/icalspanlist.c
+++ b/src/libicalss/icalspanlist.c
@@ -78,6 +78,7 @@ static void icalspanlist_new_callback(icalcomponent *comp,
struct icaltime_span *span,
void *data)
{
+ (void)comp;/*unused*/
icaltime_span *s;
icalspanlist *sl = (icalspanlist*) data;
diff --git a/src/libicalss/icalssyacc.c b/src/libicalss/icalssyacc.c
index 58961200..d7c63fa8 100644
--- a/src/libicalss/icalssyacc.c
+++ b/src/libicalss/icalssyacc.c
@@ -266,8 +266,8 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
-# if YYENABLE_NLS
-# if ENABLE_NLS
+# ifdef YYENABLE_NLS
+# ifdef ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
# endif
@@ -690,7 +690,7 @@ while (YYID (0))
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# ifdef YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
diff --git a/src/libicalvcal/icalvcal.c b/src/libicalvcal/icalvcal.c
index 4e880340..57762f43 100644
--- a/src/libicalvcal/icalvcal.c
+++ b/src/libicalvcal/icalvcal.c
@@ -234,6 +234,10 @@ icalcomponent* icalvcal_convert (VObject *object)
void* comp(int icaltype, VObject *o, icalcomponent *comp,
icalvcal_defaults *defaults)
{
+ (void)o;/*unused*/
+ (void)comp;/*unused*/
+ (void)defaults;/*unused*/
+
icalcomponent_kind kind = (icalcomponent_kind)icaltype;
icalcomponent* c = icalcomponent_new(kind);
@@ -575,6 +579,7 @@ static int get_alarm_properties (icalcomponent *comp, VObject *object,
void* alarm_comp(int icaltype, VObject *o, icalcomponent *comp,
icalvcal_defaults *defaults)
{
+ (void)comp;/*unused*/
/* icalcomponent_kind kind = (icalcomponent_kind)icaltype; */
int is_valid_alarm;
@@ -599,6 +604,10 @@ void* alarm_comp(int icaltype, VObject *o, icalcomponent *comp,
void* transp_prop(int icaltype, VObject *object, icalcomponent *comp,
icalvcal_defaults *defaults)
{
+ (void)icaltype;/*unused*/
+ (void)comp;/*unused*/
+ (void)defaults;/*unused*/
+
icalproperty *prop = NULL;
char *s;
int free_string;
@@ -622,6 +631,10 @@ void* transp_prop(int icaltype, VObject *object, icalcomponent *comp,
void* sequence_prop(int icaltype, VObject *object, icalcomponent *comp,
icalvcal_defaults *defaults)
{
+ (void)icaltype;/*unused*/
+ (void)comp;/*unused*/
+ (void)defaults;/*unused*/
+
icalproperty *prop = NULL;
char *s;
int free_string, sequence;
@@ -648,6 +661,9 @@ void* sequence_prop(int icaltype, VObject *object, icalcomponent *comp,
void* multivalued_prop(int icaltype, VObject *object, icalcomponent *comp,
icalvcal_defaults *defaults)
{
+ (void)comp;/*unused*/
+ (void)defaults;/*unused*/
+
icalproperty_kind kind = (icalproperty_kind)icaltype;
icalproperty *prop = NULL;
icalvalue *value;
@@ -685,6 +701,9 @@ void* multivalued_prop(int icaltype, VObject *object, icalcomponent *comp,
void* status_prop(int icaltype, VObject *object, icalcomponent *comp,
icalvcal_defaults *defaults)
{
+ (void)icaltype;/*unused*/
+ (void)defaults;/*unused*/
+
icalproperty *prop = NULL;
char *s;
int free_string;
@@ -735,18 +754,18 @@ void* status_prop(int icaltype, VObject *object, icalcomponent *comp,
void* utc_datetime_prop(int icaltype, VObject *object, icalcomponent *comp,
icalvcal_defaults *defaults)
{
+ (void)comp;/*unused*/
+ (void)defaults;/*unused*/
+
icalproperty_kind kind = (icalproperty_kind)icaltype;
icalproperty *prop;
icalvalue *value;
- icalvalue_kind value_kind;
char *s;
int free_string;
struct icaltimetype itt;
prop = icalproperty_new(kind);
- value_kind = icalenum_property_kind_to_value_kind (icalproperty_isa(prop));
-
s = get_string_value (object, &free_string);
/* Convert it to an icaltimetype. */
@@ -1193,6 +1212,10 @@ static char* rrule_parse_yearly_days (char *s,
void* rule_prop(int icaltype, VObject *object, icalcomponent *comp,
icalvcal_defaults *defaults)
{
+ (void)icaltype;/*unused*/
+ (void)comp;/*unused*/
+ (void)defaults;/*unused*/
+
/* icalproperty_kind kind = (icalproperty_kind)icaltype;*/
icalproperty *prop = NULL;
/* icalvalue *value; */
@@ -1271,6 +1294,9 @@ void* rule_prop(int icaltype, VObject *object, icalcomponent *comp,
void* dc_prop(int icaltype, VObject *object, icalcomponent *comp,
icalvcal_defaults *defaults)
{
+ (void)comp;/*unused*/
+ (void)defaults;/*unused*/
+
icalproperty_kind kind = (icalproperty_kind)icaltype;
icalproperty *prop;
icalvalue *value;
diff --git a/src/libicalvcal/vcc.c b/src/libicalvcal/vcc.c
index 7fcf6624..272531c6 100644
--- a/src/libicalvcal/vcc.c
+++ b/src/libicalvcal/vcc.c
@@ -70,7 +70,7 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
/* debugging utilities */
-#if __DEBUG
+#ifdef __DEBUG
#define DBG_(x) printf x
#else
#define DBG_(x)
@@ -156,14 +156,14 @@ static int ObjStackTop;
/* A helpful utility for the rest of the app. */
-#if __CPLUSPLUS__
+#if defined(__CPLUSPLUS__)
extern "C" {
#endif
extern void Parse_Debug(const char *s);
static void yyerror(char *s);
-#if __CPLUSPLUS__
+#if defined(__CPLUSPLUS__)
};
#endif
@@ -1190,7 +1190,7 @@ DLLEXPORT(VObject*) Parse_MIME(const char *input, unsigned long len)
}
-#if INCLUDEMFC
+#ifdef INCLUDEMFC
DLLEXPORT(VObject*) Parse_MIME_FromFile(CFile *file)
{
diff --git a/src/libicalvcal/vcc.h b/src/libicalvcal/vcc.h
index 0e520347..265642a0 100644
--- a/src/libicalvcal/vcc.h
+++ b/src/libicalvcal/vcc.h
@@ -1,38 +1,38 @@
/***************************************************************************
-(C) Copyright 1996 Apple Computer, Inc., AT&T Corp., International
-Business Machines Corporation and Siemens Rolm Communications Inc.
-
-For purposes of this license notice, the term Licensors shall mean,
-collectively, Apple Computer, Inc., AT&T Corp., International
-Business Machines Corporation and Siemens Rolm Communications Inc.
-The term Licensor shall mean any of the Licensors.
-
-Subject to acceptance of the following conditions, permission is hereby
-granted by Licensors without the need for written agreement and without
-license or royalty fees, to use, copy, modify and distribute this
-software for any purpose.
-
-The above copyright notice and the following four paragraphs must be
-reproduced in all copies of this software and any software including
-this software.
-
-THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS AND NO LICENSOR SHALL HAVE
-ANY OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR
-MODIFICATIONS.
-
-IN NO EVENT SHALL ANY LICENSOR BE LIABLE TO ANY PARTY FOR DIRECT,
-INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT
-OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE.
-
-EACH LICENSOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED,
-INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF NONINFRINGEMENT OR THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.
-
-The software is provided with RESTRICTED RIGHTS. Use, duplication, or
-disclosure by the government are subject to restrictions set forth in
-DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
+(C) Copyright 1996 Apple Computer, Inc., AT&T Corp., International
+Business Machines Corporation and Siemens Rolm Communications Inc.
+
+For purposes of this license notice, the term Licensors shall mean,
+collectively, Apple Computer, Inc., AT&T Corp., International
+Business Machines Corporation and Siemens Rolm Communications Inc.
+The term Licensor shall mean any of the Licensors.
+
+Subject to acceptance of the following conditions, permission is hereby
+granted by Licensors without the need for written agreement and without
+license or royalty fees, to use, copy, modify and distribute this
+software for any purpose.
+
+The above copyright notice and the following four paragraphs must be
+reproduced in all copies of this software and any software including
+this software.
+
+THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS AND NO LICENSOR SHALL HAVE
+ANY OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR
+MODIFICATIONS.
+
+IN NO EVENT SHALL ANY LICENSOR BE LIABLE TO ANY PARTY FOR DIRECT,
+INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT
+OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+EACH LICENSOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF NONINFRINGEMENT OR THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.
+
+The software is provided with RESTRICTED RIGHTS. Use, duplication, or
+disclosure by the government are subject to restrictions set forth in
+DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
***************************************************************************/
@@ -66,7 +66,7 @@ will get a link error.
*/
-#if INCLUDEMFC
+#ifdef INCLUDEMFC
extern VObject* Parse_MIME_FromFile(CFile *file);
#else
extern VObject* Parse_MIME_FromFile(FILE *file);
diff --git a/src/libicalvcal/vcc.y b/src/libicalvcal/vcc.y
index 58631df7..f276f726 100644
--- a/src/libicalvcal/vcc.y
+++ b/src/libicalvcal/vcc.y
@@ -50,7 +50,7 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
/* debugging utilities */
-#if __DEBUG
+#ifdef __DEBUG
#define DBG_(x) printf x
#else
#define DBG_(x)
@@ -138,14 +138,14 @@ static int ObjStackTop;
/* A helpful utility for the rest of the app. */
-#if __CPLUSPLUS__
+#if defined(__CPLUSPLUS__)
extern "C" {
#endif
extern void Parse_Debug(const char *s);
static void yyerror(char *s);
-#if __CPLUSPLUS__
+#if defined(__CPLUSPLUS__)
};
#endif
@@ -1142,7 +1142,7 @@ DLLEXPORT(VObject*) Parse_MIME(const char *input, unsigned long len)
}
-#if INCLUDEMFC
+#ifdef INCLUDEMFC
DLLEXPORT(VObject*) Parse_MIME_FromFile(CFile *file)
{
diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt
index 2c50dc28..e4c6ecfd 100644
--- a/src/test/CMakeLists.txt
+++ b/src/test/CMakeLists.txt
@@ -33,7 +33,7 @@ add_executable(regression ${regression_SRCS})
target_link_libraries(regression ical icalss icalvcal)
-add_test(NAME regression WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin COMMAND regression)
+add_test(NAME regression COMMAND regression)
if(WIN32)
set_tests_properties(
regression
diff --git a/src/test/copycluster.c b/src/test/copycluster.c
index c1bdc991..0548f9ab 100644
--- a/src/test/copycluster.c
+++ b/src/test/copycluster.c
@@ -44,6 +44,7 @@
#ifdef SIGALRM
static void sig_alrm(int i){
+ (void)i;/*unused*/
fprintf(stderr,"Could not get lock on file\n");
exit(1);
}
diff --git a/src/test/icaltestparser.c b/src/test/icaltestparser.c
index 017d4ffd..fd9c8455 100644
--- a/src/test/icaltestparser.c
+++ b/src/test/icaltestparser.c
@@ -90,7 +90,7 @@ char* read_stream(char *s, size_t size, void *d)
int main(int argc, char* argv[])
{
-
+ (void)argc;/*unused*/
char* line;
FILE* stream;
icalcomponent *c;
diff --git a/src/test/process.c b/src/test/process.c
index 2a5bf34d..168934fd 100644
--- a/src/test/process.c
+++ b/src/test/process.c
@@ -47,9 +47,11 @@ void send_message(icalcomponent *reply,const char* this_user)
int main(int argc, char* argv[])
{
+ (void)argc;/*unused*/
+ (void)argv;/*unused*/
+
icalcomponent *c, *next_c = NULL;
int i=0;
- const char *class_string;
int dont_remove;
icalfileset_options options = {O_RDONLY, 0644, 0, NULL};
@@ -96,8 +98,6 @@ int main(int argc, char* argv[])
class = icalclassify(c,match,this_user);
- class_string = icalproperty_enum_to_string(class);
-
/* Print out the notes associated with the incoming component
and the matched component in the */
{
@@ -267,9 +267,7 @@ conflicts with this meeting. I am proposing a time that works better for me.");
case ICAL_XLICCLASS_REQUESTRESCHEDULE: {
/* Use same rules as REQUEST_NEW */
- icalcomponent *overlaps;
- overlaps = icalclassify_find_overlaps(cal,c);
-
+ (void)icalclassify_find_overlaps(cal,c);
break;
}
case ICAL_XLICCLASS_REQUESTDELEGATE: {
diff --git a/src/test/recur.c b/src/test/recur.c
index bd1bf7ab..bddb1081 100644
--- a/src/test/recur.c
+++ b/src/test/recur.c
@@ -46,6 +46,7 @@
#endif
static void sig_alrm(int i){
+ (void)i;/*unused*/
fprintf(stderr,"Could not get lock on file\n");
exit(1);
}
@@ -54,8 +55,10 @@ static void recur_callback(icalcomponent *comp,
struct icaltime_span *span,
void *data)
{
- printf("cb: %s", ctime(&span->start));
- printf(" %s\n", ctime(&span->end));
+ (void)comp;/*unused*/
+ (void)data;/*unused*/
+ printf("cb: %s", ctime(&span->start));
+ printf(" %s\n", ctime(&span->end));
}
diff --git a/src/test/regression-recur.c b/src/test/regression-recur.c
index 6cdd71f0..aa16c3a4 100644
--- a/src/test/regression-recur.c
+++ b/src/test/regression-recur.c
@@ -45,6 +45,7 @@ extern int VERBOSE;
static void sig_alrm(int i){
+ (void)i;/*unused*/
fprintf(stderr,"Could not get lock on file\n");
exit(1);
}
@@ -81,6 +82,7 @@ static void recur_callback(icalcomponent *comp,
struct icaltime_span *span,
void *data)
{
+ (void)comp;/*unused*/
int *num_recurs = data;
if (VERBOSE) {
@@ -126,7 +128,6 @@ void test_recur_file()
for (itr = icalfileset_get_first_component(cin);
itr != 0;
itr = icalfileset_get_next_component(cin)){
- int badcomp = 0;
int expected_events = 0;
char msg[128];
@@ -146,7 +147,6 @@ void test_recur_file()
ok((char*)desc_str, !(desc == 0 || dtstart == 0 || rrule == 0));
if (desc == 0 || dtstart == 0 || rrule == 0) {
- badcomp = 1;
if (VERBOSE) {
printf("\n******** Error in input component ********\n");
printf("The following component is malformed:\n %s\n", desc_str);
diff --git a/src/test/regression-storage.c b/src/test/regression-storage.c
index aab8a747..27299232 100644
--- a/src/test/regression-storage.c
+++ b/src/test/regression-storage.c
@@ -303,7 +303,7 @@ void test_bdbset()
char *subdb, *szdata, *szpacked_data;
char uid[255];
struct icaltimetype start, end;
- icalcomponent *c,*clone, *itr;
+ icalcomponent *c, *clone, *itr;
DBT key, data;
DBC *dbcp;
@@ -696,7 +696,7 @@ void test_dirset_extended(void)
for (itr = icalfileset_get_first_component(cluster);
itr != 0;
itr = icalfileset_get_next_component(cluster)){
- icalcomponent *clone, *inner;
+ icalcomponent *inner;
icalproperty *p;
inner = icalcomponent_get_first_component(itr,ICAL_VEVENT_COMPONENT);
@@ -707,7 +707,7 @@ void test_dirset_extended(void)
/* Change the dtstart and dtend times in the component
pointed to by Itr*/
- clone = icalcomponent_new_clone(itr);
+ (void)icalcomponent_new_clone(itr);
inner = icalcomponent_get_first_component(itr,ICAL_VEVENT_COMPONENT);
ok("Duplicating component...",
@@ -752,7 +752,7 @@ void test_dirset_extended(void)
icalcomponent_new_clone(itr));
ok("Adding component to dirset", (icalerrno == ICAL_NO_ERROR));
- assert(icalerrno == ICAL_NO_ERROR);
+ assert(error == ICAL_NO_ERROR);
}
}
diff --git a/src/test/regression.h b/src/test/regression.h
index 4f1491ed..d8a3eaa7 100644
--- a/src/test/regression.h
+++ b/src/test/regression.h
@@ -36,15 +36,15 @@ char* icaltime_as_ctime(struct icaltimetype t);
void _ok(char*name, int result, char*file, int linenum, char *test);
void _is(char* test_name, const char* str1, const char* str2, char *file, int linenum);
-void _int_is(char* test_name, int i1, int i2, char *file, int linenum);
+void _int_is(char* test_name, time_t i1, time_t i2, char *file, int linenum);
#define ok(TEST, EX) (_ok(TEST, EX, __FILE__, __LINE__, #EX))
#define is(S1, S2, EX) (_is(S1, S2, EX, __FILE__, __LINE__))
#define int_is(I1, I2, EX) (_int_is(I1, I2, EX, __FILE__, __LINE__))
void test_header(char*title, int test_set);
void test_start(int);
int test_end(void);
-void test_run(char *test_name,
- void (*test_fcn)(void),
+void test_run(char *test_name,
+ void (*test_fcn)(),
int do_test, int headeronly);
diff --git a/src/test/stow.c b/src/test/stow.c
index 2836604a..a9f7ad4e 100644
--- a/src/test/stow.c
+++ b/src/test/stow.c
@@ -293,7 +293,8 @@ void return_failure(icalcomponent* comp, char* message,
/* The program had a fatal error and could not process the incoming component*/
void return_error(icalcomponent* comp, char* message, struct options_struct *opt)
{
-
+ (void)comp;/*unused*/
+ (void)opt;/*unused*/
fputs(make_mime("Dest", "Source", "iMIP system failure",
message, 0,0),stdout);
@@ -467,7 +468,6 @@ char* check_component(icalcomponent* comp, icalproperty **return_status,
}
if (found_attendee == 0){
- struct icalreqstattype rs;
memset(static_component_error_str,0,PATH_MAX);
snprintf(static_component_error_str,PATH_MAX,
@@ -475,8 +475,6 @@ char* check_component(icalcomponent* comp, icalproperty **return_status,
opt->calid );
component_error_str = static_component_error_str;
- rs.code = ICAL_3_7_INVCU_STATUS;
-
break;
}
@@ -508,6 +506,8 @@ char* check_component(icalcomponent* comp, icalproperty **return_status,
void usage(char *message)
{
+ (void)message;/*unused*/
+
fprintf(stderr,"Usage: %s [-emdcn] [-i inputfile] [-o outputfile] [-u calid]\n",program_name);
fprintf(stderr,"-e\tInput data is encapsulated in a MIME Message \n\
-m\tInput is raw iCal \n\
@@ -692,6 +692,7 @@ void get_options(int argc, char* argv[], struct options_struct *opt)
char* check_options(struct options_struct *opt)
{
+ (void)opt;/*unused*/
return 0;
}
diff --git a/src/test/timezones.c b/src/test/timezones.c
index 7b0bba18..0e379b8b 100644
--- a/src/test/timezones.c
+++ b/src/test/timezones.c
@@ -24,6 +24,8 @@
int main(int argc, char **argv)
{
+ (void)argc;/*unused*/
+ (void)argv;/*unused*/
icalarray *timezones = icaltimezone_get_builtin_timezones();
int i;
int ret = 0;