summaryrefslogtreecommitdiff
path: root/Clock.c
AgeCommit message (Collapse)Author
2019-02-27Use fabsf when dealing with floating point numbersNiclas Zeising
2019-02-27Fix logic sourrouning && and ||Niclas Zeising
Fix the logic sorrounding && and ||. && has higher precedence than ||, and as such, the if statement probably was incorrect. Fix this by adding parenthesises around the || statement.
2019-01-06Replace remaining sprintf calls with snprintfAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-05-13Allow sub-second updates.Keith Packard
Lets you run the clock at whatever tick rate you like. Note that this changes the behaviour of the clock when the update isn't a divisor of the number of seconds in a day. In the old code, the time to display was an integer number of intervals from the start of the year, in the new code, it is an integer number of intervals from the start of the day. I like that better as it makes the seconds consistent from day to day, even if it means an uneven tick at local midnight. Given that I suspect no-one has ever done this in practice, I doubt it really matters. At least the code is simpler now, while supporting updates at the level of the Xt timers, which are milliseconds. Signed-off-by: Keith Packard <keithp@keithp.com>
2015-05-07No point in trying to use iconv if we don't have nl_langinfoJon TURNEY
This fixes the build for MinGW Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: David Macek <david.macek.0@gmail.com>
2013-07-18Store sine & cosine tables as doubles instead of floatsAlan Coopersmith
Since they're used as doubles in the calculations, might as well store them that way instead of converting when read from the table at runtime. Costs about 4k more storage in the binary for the doubled tables. Also gets rid of 900 clang warnings, of the form: Clock.c:1708:11: warning: implicit conversion loses floating-point precision: 'double' to 'float' [-Wconversion] 0.000000, 0.001745, 0.003490, 0.005235, 0.006981, 0.008726, 0.010471, 0.012217, (one for each table entry) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-04Calculate text and window size from LC_CTYPE instead of LC_TIMEPeter Stuge
LC_TIME only defines what will be displayed, LC_CTYPE is what defines the character encoding. References: Bug 15903 - LANG=en_US xclock -digital -font fixed has wrong size https://bugs.freedesktop.org/show_bug.cgi?id=15903 Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-08-24Use AM_ICONVYaakov Selkowitz
AC_SEARCH_LIBS does not detect GNU libiconv because its symbols are exported in the "libiconv" namespace instead of "iconv". The AM_ICONV macro correctly detects both glibc and GNU libiconv, defines HAVE_ICONV, ICONV_CONST, and LIBICONV depending on the system. The config.rpath file is required by this macro. This adds a dependency on the aclocal macros from gettext (gettext-devel in some distros) when building from git, but not when building from a tarball. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2010-08-26Remove extraneous reference to HAS_STRLCATJeremy Huddleston
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-07-01Sun's copyrights now belong to OracleAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-01-15Update Sun license notices to current X.Org standard formAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-09-21Trim trailing whitespacesAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-01-13Ansification and compile warning fixes.Paulo Cesar Pereira de Andrade
This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects make distcheck and all gcc 4.3 and sparse warnings.
2007-12-20X.Org Bug 13537: bugs in UTF-8 handling and regularized tick updatingvdb128
X.Org Bugzilla #13537 <https://bugs.freedesktop.org/show_bug.cgi?id=13537> Patch #12964 <https://bugs.freedesktop.org/attachment.cgi?id=12964&action=view>
2007-10-22Fix logic inversion in geometry computation in -norender -digital mode.Todd C. Miller
2007-08-06Fix cast to clear sparse warning: Using plain integer as NULL pointerAlan Coopersmith
2007-06-13Don't segfault if unable to load a usable fontsetAlan Coopersmith
2007-05-18Make use of iconv() conditional on configure.ac finding it in libc or libiconvAlan Coopersmith
2007-05-18Sun bug 6518500: Use iconv() to convert other charsets to UTF8Osamu Sayama
<http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6518500>
2006-03-29Bug #6420 <https://bugs.freedesktop.org/show_bug.cgi?id=6420> Patch #5103XORG-7_0_99_901Alan Coopersmith
<https://bugs.freedesktop.org/attachment.cgi?id=5103> xclock code contains wrong "ifdef RENDER" (Kirill Belokurov)
2005-12-06Bugzilla #5251 <https://bugs.freedesktop.org/show_bug.cgi?id=5251> xclockAlan Coopersmith
-digital only shows "20" (Egmont Koblinger)
2005-07-16Add #include "config.h" for modularization Accept autoconf HAVE_STRLCPY asXORG-6_8_99_903XORG-6_8_99_902XORG-6_8_99_901XORG-6_8_99_900XORG-6_8_99_16XORG-6_8_99_15Alan Coopersmith
alias for HAS_STRLCAT
2004-10-30Add -d flag for compilers like the Sun C compilers that produce dependencyxprint_packagertest_20041217_basexprint_packagertest_20041125_basesco_port_update-baseXORG-6_8_99_9XORG-6_8_99_8XORG-6_8_99_7XORG-6_8_99_6XORG-6_8_99_5XORG-6_8_99_4XORG-6_8_99_3XORG-6_8_99_2XORG-6_8_99_14XORG-6_8_99_13XORG-6_8_99_12XORG-6_8_99_11XORG-6_8_99_10XORG-6_8_99_1xprint_packagertest_20041217xprint_packagertest_20041125sco_port_updateAlan Coopersmith
lists themselves. To use with the Sun compilers, add to host.def: # define UseCCMakeDepend YES # define DependFlags -cc $(CC) -d -xM (Sun bug id #4245688 - fix by Alan Coopersmith) Add Solaris to the platforms on which mprotect is run to set execute permissions when necessary. (Sun bug id #6175128 - fix by Alan Coopersmith) Internationalize digital output (Sun bug id #4119396 - fix by Steve Swales), add -bgpixmap option to set XPM file as background (originally from STSF project version of xclock by Alan Coopersmith) xc/programs/xmodmap/handle.c,pf.c xmodmap was printing line numbers which are one too low in error messages (Xorg bugzilla #1739, Sun bug id 4637857 - fix by Sam Lau)
2004-04-23Merging XORG-CURRENT into trunkrel-0-6-1lg3d-rel-0-7-0lg3d-rel-0-6-2lg3d-baseXORG-6_8_2XORG-6_8_1_904XORG-6_8_1_903XORG-6_8_1_902XORG-6_8_1_901XORG-6_8_1XORG-6_8_0XORG-6_7_99_904XORG-6_7_99_903XORG-6_7_99_902XORG-6_7_99_901XORG-6_7_99_2XORG-6_7_99_1XACE-SELINUX-MERGElg3d-masterlg3d-eventlg3d-dev-0-7-1lg3d-dev-0-7-0lg3d-dev-0-6-latestlg3d-dev-0-6-2lg3d-dev-0-6-1-latestlg3d-dev-0-6-1-currentlg3d-dev-0-6-1-1lg3d-dev-0-6-1lg3dXORG-6_8-branchCOMPOSITEWRAPEgbert Eich
2004-03-14Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich
2004-03-03Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0STSF-CURRENTEgbert Eich
2004-02-26readding XFree86's cvs IDsxf86-4_3_99_903Egbert Eich
2004-02-26Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004Egbert Eich
2003-11-25XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_902xf86-4_3_99_901xf86-4_3_99_16Kaleb Keithley
2003-11-14XFree86 4.3.0.1xf86-4_3_0_1PRE_xf86-4_3_0_1Kaleb Keithley
2003-11-14R6.6 is the Xorg base-lineXORG-MAINKaleb Keithley