head 1.5; access; symbols; locks; strict; comment @ * @; 1.5 date 2026.06.30.09.49.22; author wiz; state Exp; branches; next 1.4; commitid NSeaftq7QkbF0OLG; 1.4 date 2026.06.29.07.27.32; author wiz; state Exp; branches; next 1.3; commitid IBEBARM7f3ZZfFLG; 1.3 date 2022.04.08.06.16.20; author wiz; state dead; branches; next 1.2; commitid E5ydqJxpy02vsmzD; 1.2 date 2022.04.04.09.56.43; author wiz; state Exp; branches; next 1.1; commitid ywLQke909gdcORyD; 1.1 date 2022.04.03.22.13.17; author wiz; state Exp; branches; next ; commitid ox3Z51uUMWmLUNyD; desc @@ 1.5 log @xclock: switch to updated upstream patch Bump PKGREVISION. @ text @$NetBSD$ avoid uselocale() https://gitlab.freedesktop.org/xorg/app/xclock/-/merge_requests/29 --- Clock.c.orig 2026-06-27 20:18:51.000000000 +0000 +++ Clock.c @@@@ -608,8 +608,14 @@@@ XmuCvtStringToXftShape(Display * dpy, int points_allocated = 0; int count = 0; #ifndef NO_I18N - locale_t c_loc = newlocale(LC_NUMERIC_MASK, "C", NULL); - locale_t old_loc = uselocale(c_loc); + char saved_numeric[256] = ""; + { + const char *cur_numeric = setlocale(LC_NUMERIC, NULL); + if (cur_numeric != NULL && strlen(cur_numeric) < sizeof(saved_numeric)) { + strcpy(saved_numeric, cur_numeric); + setlocale(LC_NUMERIC, "C"); + } + } #endif double t1 = .01, t2 = 0, t3 = 0, t4 = 0, t5 = .01, t6 = 0; const char* errmsg = NULL; @@@@ -623,8 +629,8 @@@@ XmuCvtStringToXftShape(Display * dpy, "Number of points must be divisible by three"); shape.npoints = count; #ifndef NO_I18N - uselocale(old_loc); - freelocale(c_loc); + if (saved_numeric[0]) + setlocale(LC_NUMERIC, saved_numeric); #endif donestr(XftShape, shape, XtRXftShape); } @@@@ -709,8 +715,8 @@@@ XmuCvtStringToXftShape(Display * dpy, msgout, (String *) NULL, (Cardinal *) 0); if (shape.points) free(shape.points); #ifndef NO_I18N - uselocale(old_loc); - freelocale(c_loc); + if (saved_numeric[0]) + setlocale(LC_NUMERIC, saved_numeric); #endif return False; } @ 1.4 log @xclock: use upstream fix for NetBSD build problem @ text @d3 2 a4 1 https://gitlab.freedesktop.org/xorg/app/xclock/-/merge_requests/27 d8 1 a8 2 @@@@ -607,7 +607,7 @@@@ XmuCvtStringToXftShape(Display * dpy, XftShape shape; d11 11 a21 4 -#ifndef NO_I18N +#if !defined(NO_I18N) && defined(HAVE_USELOCALE) locale_t c_loc = newlocale(LC_NUMERIC_MASK, "C", NULL); locale_t old_loc = uselocale(c_loc); d23 3 a25 2 @@@@ -622,7 +622,7 @@@@ XmuCvtStringToXftShape(Display * dpy, XmuCvtStringToXftShape_Assert(count % 3 == 0, d28 5 a32 4 -#ifndef NO_I18N +#if !defined(NO_I18N) && defined(HAVE_USELOCALE) uselocale(old_loc); freelocale(c_loc); d34 3 a36 2 @@@@ -708,7 +708,7 @@@@ XmuCvtStringToXftShape(Display * dpy, "cvtStringToXftShape", "wrongParameters", "XtToolkitError", d39 5 a43 4 -#ifndef NO_I18N +#if !defined(NO_I18N) && defined(HAVE_USELOCALE) uselocale(old_loc); freelocale(c_loc); d45 2 @ 1.3 log @xclock: update to 1.1.1 Alan Coopersmith (2): Fall back to sin() and cos() calls on systems without sincos() xclock 1.1.1 Thomas Kuehne (2): fix -Wmissing-field-initializers warning fix -Wabsolute-value compiler warning @ text @d1 1 a1 1 $NetBSD: patch-Clock.c,v 1.2 2022/04/04 09:56:43 wiz Exp $ d3 1 a3 2 NetBSD does not provide sincos(). https://gitlab.freedesktop.org/xorg/app/xclock/-/merge_requests/9 d5 1 a5 1 --- Clock.c.orig 2022-04-03 21:23:33.000000000 +0000 d7 27 a33 10 @@@@ -1734,7 +1734,8 @@@@ erase_hands(ClockWidget w, struct tm *tm static void ClockAngle(double tick_units, double *sinp, double *cosp) { - sincos(tick_units * (M_PI / 180 / 10.0), sinp, cosp); + *sinp = sin(tick_units * (M_PI / 180 / 10.0)); + *cosp = cos(tick_units * (M_PI / 180 / 10.0)); } /* @ 1.2 log @xclock: add upstream bug report URL @ text @d1 1 a1 1 $NetBSD: patch-Clock.c,v 1.1 2022/04/03 22:13:17 wiz Exp $ @ 1.1 log @xclock: update to 1.1.0. Alan Coopersmith (5): Fix build on Solaris Fix spelling/wording issues gitlab CI: add a basic build test Build xz tarballs instead of bzip2 xclock 1.1.0 Keith Packard (1): Update hands smoothly in Render mode rees4905 (2): re-indent Clock.c man: Indicate that -twelve & -twentyfour only affect brief display @ text @d1 1 a1 1 $NetBSD$ d4 1 @