diff options
author | ade <ade@FreeBSD.org> | 2002-03-13 08:40:16 +0800 |
---|---|---|
committer | ade <ade@FreeBSD.org> | 2002-03-13 08:40:16 +0800 |
commit | 6cd8d4970163f0c624ef2ed5e1283d780e7c49e2 (patch) | |
tree | 299857e2d5a707557c3e59023c5349b15537ba5d /misc | |
parent | 50572b4032acadf843aeeecaa5fb8d4ded2fe61d (diff) | |
download | freebsd-ports-gnome-6cd8d4970163f0c624ef2ed5e1283d780e7c49e2.tar.gz freebsd-ports-gnome-6cd8d4970163f0c624ef2ed5e1283d780e7c49e2.tar.zst freebsd-ports-gnome-6cd8d4970163f0c624ef2ed5e1283d780e7c49e2.zip |
Fix various warning errors from libmcal's CVS tree
PR: 34089
Submitted by: MAINTAINER
Diffstat (limited to 'misc')
-rw-r--r-- | misc/libmcal/Makefile | 2 | ||||
-rw-r--r-- | misc/libmcal/files/patch-ag | 11 | ||||
-rw-r--r-- | misc/libmcal/files/patch-aj | 25 | ||||
-rw-r--r-- | misc/libmcal/files/patch-al | 210 |
4 files changed, 183 insertions, 65 deletions
diff --git a/misc/libmcal/Makefile b/misc/libmcal/Makefile index 4be8d36fee3e..0e02d634d1d4 100644 --- a/misc/libmcal/Makefile +++ b/misc/libmcal/Makefile @@ -7,7 +7,7 @@ PORTNAME= libmcal PORTVERSION= 0.6 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= misc MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} diff --git a/misc/libmcal/files/patch-ag b/misc/libmcal/files/patch-ag index e3217bded96c..f73288c5191c 100644 --- a/misc/libmcal/files/patch-ag +++ b/misc/libmcal/files/patch-ag @@ -1,16 +1,17 @@ --- icalroutines.c.orig Tue Jan 25 04:08:10 2000 -+++ icalroutines.c Thu May 11 21:43:23 2000 ++++ icalroutines.c Sun Jan 20 13:21:22 2002 @@ -1,5 +1,5 @@ /* - * #$Id: icalroutines.c,v 1.1 2000/01/25 03:08:10 markie Exp $ -+ * #$Id: icalroutines.c,v 1.2 2000/05/11 19:43:23 inan Exp $ ++ * #$Id: icalroutines.c,v 1.3 2001/12/10 03:16:41 chuck Exp $ * * Libmcal - Modular Calendar Access Library * Copyright (C) 1999 Mark Musone and Andrew Skalski -@@ -594,3 +594,110 @@ +@@ -593,4 +593,111 @@ + } putc(pad, out); } - } ++} + +#define MAX(a,b) (a)>(b) ? (a) :(b) +void @@ -117,4 +118,4 @@ + } else { + *output = RECUR_NONE; + } -+} + } diff --git a/misc/libmcal/files/patch-aj b/misc/libmcal/files/patch-aj index 6831a5b26f88..6ecc29e8dbde 100644 --- a/misc/libmcal/files/patch-aj +++ b/misc/libmcal/files/patch-aj @@ -1,9 +1,9 @@ --- mcal.c.orig Sun Feb 27 06:01:54 2000 -+++ mcal.c Tue Jan 9 04:26:48 2001 ++++ mcal.c Sun Jan 20 13:13:15 2002 @@ -1,5 +1,5 @@ /* - * $Id: mcal.c,v 1.6 2000/02/27 05:01:54 inan Exp $ -+ * $Id: mcal.c,v 1.9 2001/01/09 03:26:48 markie Exp $ ++ * $Id: mcal.c,v 1.10 2001/12/10 03:16:41 chuck Exp $ * Libmcal - Modular Calendar Access Library * Copyright (C) 1999 Mark Musone and Andrew Skalski * @@ -121,19 +121,21 @@ static bool dummy_search_range( CALSTREAM *stream, const datetime_t *start, const datetime_t *end); -@@ -967,18 +1023,28 @@ +@@ -966,6 +1022,13 @@ + unsigned long id); static bool dummy_snooze( CALSTREAM *stream, unsigned long id); - ++static bool dummy_store( CALSTREAM *stream, ++ const CALEVENT *event); +static bool dummy_delete( CALSTREAM *stream, + char *calendar); + +static bool dummy_rename( CALSTREAM *stream, + char *src,char *dest); -+ + const CALDRIVER dummy_driver = { - dummy_valid, +@@ -973,12 +1036,17 @@ dummy_open, dummy_close, dummy_ping, @@ -144,13 +146,14 @@ dummy_append, dummy_remove, dummy_snooze, ++ dummy_store, + dummy_delete, + dummy_rename, + }; -@@ -1011,6 +1077,12 @@ +@@ -1011,6 +1079,12 @@ return false; } @@ -163,7 +166,7 @@ bool dummy_search_range( CALSTREAM *stream, -@@ -1052,6 +1124,18 @@ +@@ -1052,6 +1126,24 @@ bool dummy_snooze(CALSTREAM *stream, unsigned long id) @@ -172,6 +175,12 @@ +} + +bool ++dummy_store(CALSTREAM *stream, const CALEVENT *event) ++{ ++ return false; ++} ++ ++bool +dummy_delete(CALSTREAM *stream, char *calendar) +{ + return false; diff --git a/misc/libmcal/files/patch-al b/misc/libmcal/files/patch-al index 9f0e4019b1ff..623708c88fbc 100644 --- a/misc/libmcal/files/patch-al +++ b/misc/libmcal/files/patch-al @@ -1,13 +1,14 @@ --- mstore/mstore.c.orig Mon Mar 27 06:07:12 2000 -+++ mstore/mstore.c Tue Dec 11 08:56:58 2001 -@@ -1,4 +1,4 @@ ++++ mstore/mstore.c Sun Jan 20 13:36:14 2002 +@@ -1,31 +1,39 @@ -/* $Id: mstore.c,v 1.11 2000/03/27 04:07:12 zircote Exp $ */ -+/* $Id: mstore.c,v 1.21 2001/05/07 17:37:10 chuck Exp $ */ ++/* $Id: mstore.c,v 1.22 2001/12/25 02:41:44 chuck Exp $ */ #include <stdlib.h> #include <string.h> -@@ -6,26 +6,33 @@ + #include <errno.h> #include <pwd.h> ++#include <sys/time.h> #include <unistd.h> #include <crypt.h> + @@ -43,7 +44,7 @@ static bool mstore_search_range( CALSTREAM *stream, const datetime_t *start, const datetime_t *end); -@@ -44,12 +51,18 @@ +@@ -44,12 +52,18 @@ unsigned long id); static bool mstore_store( CALSTREAM *stream, const CALEVENT *modified_event); @@ -62,7 +63,7 @@ mstore_search_range, mstore_search_alarm, mstore_fetch, -@@ -57,6 +70,8 @@ +@@ -57,6 +71,8 @@ mstore_remove, mstore_snooze, mstore_store, @@ -71,7 +72,7 @@ }; -@@ -88,13 +103,98 @@ +@@ -88,13 +104,98 @@ } @@ -171,7 +172,7 @@ if(!mpasswd) { printf("Error! couldn't open mpasswd file!\n"); -@@ -123,36 +223,31 @@ +@@ -123,36 +224,31 @@ } fclose(mpasswd); return false; @@ -233,7 +234,7 @@ } -@@ -161,8 +256,6 @@ +@@ -161,8 +257,6 @@ { if (!addr->proto || strcasecmp(addr->proto, "mstore")) return false; @@ -242,7 +243,7 @@ return true; } -@@ -197,10 +290,18 @@ +@@ -197,10 +291,18 @@ } cc_login(&username, &password); @@ -263,7 +264,7 @@ } if (!reopen) { -@@ -212,13 +313,23 @@ +@@ -212,13 +314,23 @@ if (options & CAL_LOGIN) { /* Copy login_userbuf, folder. */ @@ -289,7 +290,7 @@ /* Set up folder_user */ if(addr->host) -@@ -229,8 +340,13 @@ +@@ -229,8 +341,13 @@ DATA->login_user=DATA->login_userbuf; if (addr->user) { /* Copy and split folder_userbuf */ @@ -304,7 +305,7 @@ /* Check for identical folder/login users. */ DATA->folder_user=DATA->folder_userbuf; if ( !strcmp(DATA->login_user, DATA->folder_user)) -@@ -246,7 +362,6 @@ +@@ -246,7 +363,6 @@ DATA->folder_user = DATA->login_user; } @@ -312,7 +313,7 @@ return stream; fail: mstore_freestream(stream); -@@ -270,6 +385,36 @@ +@@ -270,6 +386,36 @@ } @@ -349,17 +350,7 @@ CALEVENT *read_event(FILE *calfile) { char line[100]; -@@ -277,7 +422,8 @@ - int size; - CALEVENT *event; - -- fgets(line, sizeof(line), calfile); -+ if (fgets(line, sizeof(line), calfile) == NULL) -+ return NULL; - if (sscanf(line, "%d", &size) != 1) - return NULL; - buf = malloc(size + 2); -@@ -334,17 +480,18 @@ +@@ -334,79 +480,75 @@ datetime_t _end = DT_INIT; FILE *calfile; char userpath[1000]; @@ -378,21 +369,74 @@ rewind(calfile); if (start) { - if (!dt_hasdate(start)) -+//LM:should this be _start = NULL? and again below for end? - start = NULL; - else { - dt_setdate(&_start, -@@ -358,7 +505,7 @@ - dt_setdate(&_end, end->year, end->mon, end->mday); +- if (!dt_hasdate(start)) +- start = NULL; +- else { +- dt_setdate(&_start, +- start->year, start->mon, start->mday); +- } ++ if (!dt_hasdate(start)) { ++ // LM:should this be _start = NULL? and again below for end? ++ start = NULL; ++ } else { ++ dt_setdate(&_start, ++ start->year, start->mon, start->mday); ++ } } - + if (end) { +- if (!dt_hasdate(end)) +- end = NULL; +- else +- dt_setdate(&_end, end->year, end->mon, end->mday); +- } +- - while((event=read_event(calfile))) { -+ while((event = read_event(calfile))) { - datetime_t clamp = DT_INIT; +- datetime_t clamp = DT_INIT; +- +- if (!start) +- dt_setdate(&clamp, 1, JANUARY, 1); +- else { +- dt_setdate(&clamp, +- _start.year, _start.mon, _start.mday); +- } ++ if (!dt_hasdate(end)) ++ end = NULL; ++ else ++ dt_setdate(&_end, end->year, end->mon, end->mday); ++ } ++ ++ while ((event = read_event(calfile))) { ++ datetime_t clamp = DT_INIT; ++ ++ if (!start) { ++ dt_setdate(&clamp, 1, JANUARY, 1); ++ } else { ++ dt_setdate(&clamp, ++ _start.year, _start.mon, _start.mday); ++ } + +- calevent_next_recurrence(event, &clamp, stream->startofweek); +- if ( dt_hasdate(&clamp) && +- !(end && dt_compare(&clamp, &_end) > 0)) +- { +- cc_searched(event->id); +- } ++ calevent_next_recurrence(event, &clamp, stream->startofweek); ++ if (dt_hasdate(&clamp) && ++ !(end && dt_compare(&clamp, &_end) > 0)) { ++ cc_searched(event->id); ++ } + +- calevent_free(event); ++ calevent_free(event); + } +- fclose(calfile); +- return true; ++ fclose(calfile); ++ return true; + } + - if (!start) -@@ -385,28 +532,24 @@ bool mstore_search_alarm(CALSTREAM *stream, const datetime_t *when) { @@ -409,8 +453,8 @@ - if(!calfile) - { + snprintf(userpath, 900, "%s/%s", DATA->base_path, DATA->folder_user); -+ calfile=fopen (userpath, "a+"); -+ if(!calfile) { ++ calfile = fopen (userpath, "a+"); ++ if (!calfile) { printf("Error! couldn't open calendar file!\n"); exit(1); - } @@ -431,7 +475,7 @@ } calevent_free(event); } -@@ -422,13 +565,12 @@ +@@ -422,13 +564,12 @@ FILE *calfile; char userpath[1000]; @@ -449,19 +493,83 @@ rewind(calfile); while((event=read_event(calfile))) { if(event->id==id) { -@@ -459,8 +601,11 @@ - if (strcasecmp(addr->folder, "INBOX")) - return false; +@@ -445,43 +586,45 @@ + + + bool +-mstore_append( CALSTREAM *stream, const CALADDR *addr, +- unsigned long *id, const CALEVENT *event) ++mstore_append(CALSTREAM *stream, const CALADDR *addr, ++ unsigned long *id, const CALEVENT *event) + { +- CALEVENT myevent; +- FILE *calfile; +- char userpath[1000]; ++ CALEVENT myevent; ++ FILE *calfile; ++ char userpath[1000]; ++ ++ if (addr->host) { ++ return false; ++ } ++ if (addr->user) { ++ return false; ++ } ++ if (strcasecmp(addr->folder, "INBOX")) { ++ return false; ++ } + +- if (addr->host) +- return false; +- if (addr->user) +- return false; +- if (strcasecmp(addr->folder, "INBOX")) +- return false; ++ if (!dt_hasdate(&event->start)) { ++ return false; ++ } + +- if (DATA->folder_userbuf) +- return false; +- if (!dt_hasdate(&event->start)) +- return false; ++ snprintf(userpath, 900, "%s/%s", DATA->base_path, DATA->folder_user); ++ calfile = fopen(userpath, "a"); ++ if (!calfile) { ++ printf("Error! couldn't open calendar file %s\n",userpath); ++ perror("mstore_append"); ++ return false; ++ } + +- snprintf(userpath,900,"%s/%s",DATA->base_path,DATA->folder_user); +- calfile=fopen (userpath,"a"); +- if(!calfile) +- { +- printf("Error! couldn't open calendar file %s\n",userpath); +- perror("mstore_append"); +- return false; +- } +- +- myevent = *event; +- myevent.id = time(NULL); +- write_event(calfile, &myevent); ++ myevent = *event; ++ myevent.id = time(NULL); ++ ++ write_event(calfile, &myevent); + +- fclose(calfile); ++ fclose(calfile); + +- *id = myevent.id; ++ *id = myevent.id; + +- return true; ++ return true; + } -+ /* comment this out so that we can share calendars - if (DATA->folder_userbuf) - return false; -+ */ -+ - if (!dt_hasdate(&event->start)) - return false; -@@ -609,3 +754,15 @@ +@@ -609,3 +752,15 @@ return true; } |