Changeset 793
- Timestamp:
- 05/01/07 03:39:00 (2 years ago)
- Files:
-
- 1.8.2/branches/devel/CHANGES.182 (modified) (1 diff)
- 1.8.2/branches/devel/src/bsd.c (modified) (5 diffs)
- 1.8.2/branches/devel/src/cque.c (modified) (6 diffs)
- 1.8.2/branches/devel/src/funstr.c (modified) (2 diffs)
- 1.8.2/branches/devel/src/game.c (modified) (5 diffs)
- 1.8.2/branches/devel/src/look.c (modified) (2 diffs)
- 1.8.2/branches/devel/src/parse.c (modified) (1 diff)
- 1.8.2/branches/devel/src/rob.c (modified) (2 diffs)
- 1.8.2/branches/devel/src/wiz.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.2/branches/devel/CHANGES.182
r786 r793 42 42 problems when trying to log out of a shell after starting 43 43 a mush. Reported by K Moon. [SW] 44 * NetBSD compile and general warning fixes. [SW] 45 * Favor difftime(3) over subtraction of time_t variables. [SW] 44 46 45 47 Version 1.8.2 patchlevel 3 March 11, 2007 1.8.2/branches/devel/src/bsd.c
r774 r793 374 374 extern Pid_t forked_dump_pid; /**< Process id of forking dump process */ 375 375 static void dump_users(DESC *call_by, char *match, int doing); 376 static const char *time_format_1( long int dt);377 static const char *time_format_2( long int dt);376 static const char *time_format_1(time_t dt); 377 static const char *time_format_2(time_t dt); 378 378 static void announce_connect(dbref player, int isnew, int num); 379 379 static void announce_disconnect(DESC *saved); … … 2559 2559 if (ModTime(player)) 2560 2560 notify_format(player, T("%ld failed connections since last login."), 2561 ModTime(player));2561 (long)ModTime(player)); 2562 2562 ModTime(player) = (time_t) 0; 2563 2563 announce_connect(player, isnew, num); /* broadcast connect message */ … … 3299 3299 3300 3300 static const char * 3301 time_format_1( longdt)3301 time_format_1(time_t dt) 3302 3302 { 3303 3303 register struct tm *delta; 3304 time_t holder; /* A hack for 64bit SGI */ 3304 3305 3305 static char buf[64]; 3306 3306 if (dt < 0) 3307 3307 dt = 0; 3308 holder = (time_t) dt; 3309 delta = gmtime(& holder);3308 3309 delta = gmtime(&dt); 3310 3310 if (delta->tm_yday > 0) { 3311 3311 sprintf(buf, "%dd %02d:%02d", … … 3318 3318 3319 3319 static const char * 3320 time_format_2( longdt)3320 time_format_2(time_t dt) 3321 3321 { 3322 3322 register struct tm *delta; … … 3325 3325 dt = 0; 3326 3326 3327 delta = gmtime( (time_t *)& dt);3327 delta = gmtime(& dt); 3328 3328 if (delta->tm_yday > 0) { 3329 3329 sprintf(buf, "%dd", delta->tm_yday); 1.8.2/branches/devel/src/cque.c
r701 r793 50 50 dbref sem; /**< semaphore object to block on */ 51 51 char *semattr; /**< semaphore attribute to block on */ 52 int left; /**< seconds left until execution */52 time_t left; /**< seconds left until execution */ 53 53 char *env[10]; /**< environment, from wild match */ 54 54 char *rval[NUMQ]; /**< environment, from setq() */ … … 614 614 item on it. Anything else is wasted time. */ 615 615 if (qwait) { 616 curr = qwait->left - mudtime;616 curr = (int)difftime(qwait->left, mudtime); 617 617 if (curr <= 2) 618 618 return 1; … … 624 624 if (point->left == 0) /* no timeout */ 625 625 continue; 626 curr = point->left - mudtime;626 curr = (int)difftime(point->left, mudtime); 627 627 if (curr <= 2) 628 628 return 1; … … 880 880 /* get timeout, default of -1 */ 881 881 if (tcount && *tcount) 882 waitfor = atol(tcount);882 waitfor = parse_integer(tcount); 883 883 else 884 884 waitfor = -1; … … 914 914 switch (q_type) { 915 915 case 1: /* wait queue */ 916 notify_format(player, "[%ld]%s: %s", tmp->left - mudtime,916 notify_format(player, "[%ld]%s: %s", (long)difftime(tmp->left, mudtime), 917 917 unparse_object(player, tmp->player), tmp->comm); 918 918 break; … … 920 920 if (tmp->left != 0) { 921 921 notify_format(player, "[#%d/%s/%ld]%s: %s", tmp->sem, 922 tmp->semattr, tmp->left - mudtime,922 tmp->semattr, (long)difftime(tmp->left, mudtime), 923 923 unparse_object(player, tmp->player), tmp->comm); 924 924 } else { 1.8.2/branches/devel/src/funstr.c
r766 r793 177 177 return; 178 178 } 179 c = tolower(*p);179 c = DOWNCASE(*p); 180 180 if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') 181 181 safe_str("an", buff, bp); … … 490 490 return; 491 491 } else if (nargs == 3) { 492 type = toupper(*args[2]);492 type = UPCASE(*args[2]); 493 493 } 494 494 1.8.2/branches/devel/src/game.c
r784 r793 2126 2126 T 2127 2127 ("Time until next database save: %ld minutes %ld seconds, at %s"), 2128 ( options.dump_counter - mudtime) / 60,2129 ( options.dump_counter - mudtime) % 60, tbuf1);2128 ((long)difftime(options.dump_counter, mudtime)) / 60, 2129 ((long)difftime(options.dump_counter, mudtime)) % 60, tbuf1); 2130 2130 2131 2131 when = localtime(&options.dbck_counter); … … 2134 2134 T 2135 2135 (" Time until next dbck check: %ld minutes %ld seconds, at %s."), 2136 ( options.dbck_counter - mudtime) / 60,2137 ( options.dbck_counter - mudtime) % 60, tbuf1);2136 ((long)difftime(options.dbck_counter, mudtime)) / 60, 2137 ((long)difftime(options.dbck_counter, mudtime)) % 60, tbuf1); 2138 2138 2139 2139 when = localtime(&options.purge_counter); … … 2142 2142 T 2143 2143 (" Time until next purge: %ld minutes %ld seconds, at %s."), 2144 ( options.purge_counter - mudtime) / 60,2145 ( options.purge_counter - mudtime) % 60, tbuf1);2144 ((long)difftime(options.purge_counter, mudtime)) / 60, 2145 ((long)difftime(options.purge_counter, mudtime)) % 60, tbuf1); 2146 2146 2147 2147 if (options.warn_interval) { … … 2151 2151 T 2152 2152 (" Time until next @warnings: %ld minutes %ld seconds, at %s."), 2153 ( options.warn_counter - mudtime) / 60,2154 ( options.warn_counter - mudtime) % 60, tbuf1);2153 ((long)difftime(options.warn_counter, mudtime)) / 60, 2154 ((long)difftime(options.warn_counter, mudtime)) % 60, tbuf1); 2155 2155 } 2156 2156 … … 2158 2158 T 2159 2159 ("PennMUSH Uptime: %ld days %ld hours %ld minutes %ld seconds"), 2160 ( mudtime - globals.first_start_time) / 86400,2161 (( mudtime -globals.first_start_time) % 86400) / 3600,2162 ((( mudtime -globals.first_start_time) % 86400) % 3600) / 60,2163 ((( mudtime -globals.first_start_time) % 86400) % 3600) % 60);2160 ((long)difftime(mudtime, globals.first_start_time)) / 86400, 2161 ((long)difftime(mudtime, globals.first_start_time) % 86400) / 3600, 2162 (((long)difftime(mudtime, globals.first_start_time) % 86400) % 3600) / 60, 2163 (((long)difftime(mudtime, globals.first_start_time) % 86400) % 3600) % 60); 2164 2164 2165 2165 /* Mortals, go no further! */ 1.8.2/branches/devel/src/look.c
r641 r793 28 28 #include "parse.h" 29 29 #include "privtab.h" 30 #include "log.h" 31 #include "case.h" 30 32 #include "confmagic.h" 31 #include "log.h" 33 32 34 33 35 static void look_exits(dbref player, dbref loc, const char *exit_name); … … 1613 1615 /* If background color, change the letter to a capital. */ 1614 1616 if (*(ptr - 1) == '4') 1615 ansi_letter = toupper(ansi_letter);1617 ansi_letter = UPCASE(ansi_letter); 1616 1618 safe_chr(ansi_letter, value, &s); 1617 1619 } 1.8.2/branches/devel/src/parse.c
r776 r793 812 812 goto exit_sequence; 813 813 (*str)++; 814 if (!isdigit( nextc)) {814 if (!isdigit((unsigned char)nextc)) { 815 815 safe_str(T(e_int), buff, bp); 816 816 break; 1.8.2/branches/devel/src/rob.c
r709 r793 549 549 return; 550 550 } 551 while ((s > arg) && isspace( *(s - 1))) {551 while ((s > arg) && isspace((unsigned char)*(s - 1))) { 552 552 s--; 553 553 } … … 559 559 s = (char *) string_match(s, "TO "); 560 560 s += 3; 561 while (*s && isspace( *s))561 while (*s && isspace((unsigned char)*s)) 562 562 s++; 563 563 if (!*s) { 1.8.2/branches/devel/src/wiz.c
r527 r793 1825 1825 /* A special old-timey kludge */ 1826 1826 if (class && !*class && restriction && *restriction) { 1827 if (isdigit( *restriction) || ((*restriction == '#') && *(restriction + 1)1828 && isdigit(*(restriction + 1)))) {1827 if (isdigit((unsigned char)*restriction) || ((*restriction == '#') && *(restriction + 1) 1828 && isdigit((unsigned char)*(restriction + 1)))) { 1829 1829 size_t offset = 0; 1830 1830 if (*restriction == '#') … … 1838 1838 if (!class || !*class || !restriction) 1839 1839 continue; 1840 if (isdigit( *class) ||1841 ((*class == '#') && *(class + 1) && isdigit( *(class + 1)))) {1840 if (isdigit((unsigned char)*class) || 1841 ((*class == '#') && *(class + 1) && isdigit((unsigned char)*(class + 1)))) { 1842 1842 size_t offset = 0; 1843 1843 if (*class == '#') … … 1846 1846 if (!GoodObject(spec->low)) 1847 1847 spec->low = 0; 1848 if (isdigit( *restriction) || ((*restriction == '#') && *(restriction + 1)1849 && isdigit(*(restriction + 1)))) {1848 if (isdigit((unsigned char)*restriction) || ((*restriction == '#') && *(restriction + 1) 1849 && isdigit((unsigned char)*(restriction + 1)))) { 1850 1850 offset = 0; 1851 1851 if (*restriction == '#')
