Patch level 6 for Dclock To apply this patch, you should do: cd /contrib/programs/Dclock patch < thisfile Changes: + A problem redrawing the date at midnight was fixed. + Various compiler warnings were cleaned up. Andrew Skalski askalski@buffalo.edu diff -c -r orig/Dclock/Dclock.c Dclock/Dclock.c *** orig/Dclock/Dclock.c Tue Jun 16 01:22:42 1998 --- Dclock/Dclock.c Tue Jun 16 02:54:41 1998 *************** *** 4,9 **** --- 4,12 ---- * Modified 1991 Herve Soulard * - support for English and French language * - support for audio on Sparc station + * Modified 1998 Andrew Skalski + * - fixed a problem redrawing the date at midnight + * - added typecasts to get rid of some compiler warnings * * Copyright (c) 1988-1994 Dan Heller * *************** *** 163,169 **** /* num_actions */ XtNumber(actionsList), /* resources */ resources, /* resource_count */ XtNumber(resources), ! /* xrm_class */ NULL, /* compress_motion */ TRUE, /* compress_exposure */ TRUE, /* compress_enterleave */ TRUE, --- 166,172 ---- /* num_actions */ XtNumber(actionsList), /* resources */ resources, /* resource_count */ XtNumber(resources), ! /* xrm_class */ (XrmClass) NULL, /* compress_motion */ TRUE, /* compress_exposure */ TRUE, /* compress_enterleave */ TRUE, *************** *** 416,423 **** if (w->dclock.interval_id != (XtIntervalId)NULL) XtRemoveTimeOut(w->dclock.interval_id); ! XtReleaseGC (w, w->dclock.foreGC); ! XtReleaseGC (w, w->dclock.backGC); for (n = 0; n < 10; n++) { XFreePixmap(XtDisplay(w), w->dclock.digits[n]); XFreePixmap(XtDisplay(w), w->dclock.tiny_digits[n]); --- 419,426 ---- if (w->dclock.interval_id != (XtIntervalId)NULL) XtRemoveTimeOut(w->dclock.interval_id); ! XtReleaseGC ((Widget) w, w->dclock.foreGC); ! XtReleaseGC ((Widget) w, w->dclock.backGC); for (n = 0; n < 10; n++) { XFreePixmap(XtDisplay(w), w->dclock.digits[n]); XFreePixmap(XtDisplay(w), w->dclock.tiny_digits[n]); *************** *** 437,443 **** Pixmap pix; GC gc = w->dclock.foreGC; ! if (!XtIsRealized(w)) return; winwidth = w->core.width; --- 440,446 ---- Pixmap pix; GC gc = w->dclock.foreGC; ! if (!XtIsRealized((Widget) w)) return; winwidth = w->core.width; *************** *** 499,505 **** make_number(w, w->dclock.tiny_digits[i], gc, i, tiny_segment_pts); } else ! w->dclock.tiny_digits[i] = NULL; } /* The colon[0] area is blank */ if (w->dclock.colon[0]) --- 502,508 ---- make_number(w, w->dclock.tiny_digits[i], gc, i, tiny_segment_pts); } else ! (Widget) w->dclock.tiny_digits[i] = (Pixmap) NULL; } /* The colon[0] area is blank */ if (w->dclock.colon[0]) *************** *** 678,684 **** Boolean save_fade = w->dclock.fade; long t; ! if (!XtIsRealized(w)) return; if (w->dclock.interval_id != (XtIntervalId)NULL) { --- 681,687 ---- Boolean save_fade = w->dclock.fade; long t; ! if (!XtIsRealized((Widget) w)) return; if (w->dclock.interval_id != (XtIntervalId)NULL) { *************** *** 883,889 **** turn_off[i] = oldmask & ~newmask; } else ! tmp_pix[i] = NULL; for (j = 1; j != FADE_ITER; ++j) { --- 886,892 ---- turn_off[i] = oldmask & ~newmask; } else ! tmp_pix[i] = (Pixmap) NULL; for (j = 1; j != FADE_ITER; ++j) { *************** *** 972,978 **** if (*p != '%') *datep++ = *p; else switch (*++p) { ! when 'M': if (!strcmp(w->dclock.language, "English")) datep += strlen(strcpy(datep, MonthsE[now->tm_mon])); else --- 975,981 ---- if (*p != '%') *datep++ = *p; else switch (*++p) { ! case 'M': if (!strcmp(w->dclock.language, "English")) datep += strlen(strcpy(datep, MonthsE[now->tm_mon])); else *************** *** 1015,1021 **** /* remove what was there in case the whole thing isn't overwritten */ XFillRectangle(XtDisplay(w), XtWindow(w), w->dclock.backGC, ! 0, winheight - (w->dclock.font->ascent + w->dclock.font->descent), winwidth, w->dclock.font->ascent + w->dclock.font->descent); XDrawString(XtDisplay(w), XtWindow(w), w->dclock.foreGC, --- 1018,1024 ---- /* remove what was there in case the whole thing isn't overwritten */ XFillRectangle(XtDisplay(w), XtWindow(w), w->dclock.backGC, ! 0, winheight - (w->dclock.font->ascent + BORDER), winwidth, w->dclock.font->ascent + w->dclock.font->descent); XDrawString(XtDisplay(w), XtWindow(w), w->dclock.foreGC, *************** *** 1069,1076 **** || new->dclock.tails != current->dclock.tails || new->dclock.fade != current->dclock.fade || new->dclock.miltime != current->dclock.miltime) { ! XtReleaseGC (current, current->dclock.foreGC); ! XtReleaseGC (current, current->dclock.backGC); GetGC(new); Resize(new); /* pixmaps need to be redrawn */ do_redraw = True; --- 1072,1079 ---- || new->dclock.tails != current->dclock.tails || new->dclock.fade != current->dclock.fade || new->dclock.miltime != current->dclock.miltime) { ! XtReleaseGC ((Widget) current, current->dclock.foreGC); ! XtReleaseGC ((Widget) current, current->dclock.backGC); GetGC(new); Resize(new); /* pixmaps need to be redrawn */ do_redraw = True; *************** *** 1133,1139 **** Arg arg; XtSetArg(arg, XtNreverseVideo, !w->dclock.reverse); ! XtSetValues(w, &arg, 1); } static void --- 1136,1142 ---- Arg arg; XtSetArg(arg, XtNreverseVideo, !w->dclock.reverse); ! XtSetValues((Widget) w, &arg, 1); } static void *************** *** 1147,1153 **** return; } XtSetArg(arg, XtNmilitaryTime, !w->dclock.miltime); ! XtSetValues(w, &arg, 1); } static void --- 1150,1156 ---- return; } XtSetArg(arg, XtNmilitaryTime, !w->dclock.miltime); ! XtSetValues((Widget) w, &arg, 1); } static void *************** *** 1161,1167 **** return; } XtSetArg(arg, XtNseconds, !w->dclock.seconds); ! XtSetValues(w, &arg, 1); } static void --- 1164,1170 ---- return; } XtSetArg(arg, XtNseconds, !w->dclock.seconds); ! XtSetValues((Widget) w, &arg, 1); } static void *************** *** 1171,1177 **** Arg arg; XtSetArg(arg, XtNfade, !w->dclock.fade); ! XtSetValues(w, &arg, 1); if (w->dclock.fade && w->dclock.scroll) toggle_scroll(w); } --- 1174,1180 ---- Arg arg; XtSetArg(arg, XtNfade, !w->dclock.fade); ! XtSetValues((Widget) w, &arg, 1); if (w->dclock.fade && w->dclock.scroll) toggle_scroll(w); } *************** *** 1183,1189 **** Arg arg; XtSetArg(arg, XtNtails, !w->dclock.tails); ! XtSetValues(w, &arg, 1); } static void --- 1186,1192 ---- Arg arg; XtSetArg(arg, XtNtails, !w->dclock.tails); ! XtSetValues((Widget) w, &arg, 1); } static void *************** *** 1193,1199 **** Arg arg; XtSetArg(arg, XtNalarm, !w->dclock.alarm); ! XtSetValues(w, &arg, 1); } static void --- 1196,1202 ---- Arg arg; XtSetArg(arg, XtNalarm, !w->dclock.alarm); ! XtSetValues((Widget) w, &arg, 1); } static void *************** *** 1206,1212 **** XtSetArg(arg, XtNlanguage, "French"); else XtSetArg(arg, XtNlanguage, "English"); ! XtSetValues(w, &arg, 1); Redisplay(w); } --- 1209,1215 ---- XtSetArg(arg, XtNlanguage, "French"); else XtSetArg(arg, XtNlanguage, "English"); ! XtSetValues((Widget) w, &arg, 1); Redisplay(w); } *************** *** 1247,1253 **** int digit = w->dclock.alarm_time[i>1?i+1:i] - '0'; int mod; switch (i) { ! when 0: if (Alarm.hrs > 13 && digit == 1) digit++; mod = 3; --- 1250,1256 ---- int digit = w->dclock.alarm_time[i>1?i+1:i] - '0'; int mod; switch (i) { ! case 0: if (Alarm.hrs > 13 && digit == 1) digit++; mod = 3; diff -c -r orig/Dclock/patchlevel.h Dclock/patchlevel.h *** orig/Dclock/patchlevel.h Tue Jun 16 01:22:46 1998 --- Dclock/patchlevel.h Tue Jun 16 02:41:38 1998 *************** *** 1 **** ! #define PATCHLEVEL 5 --- 1 ---- ! #define PATCHLEVEL 6