summaryrefslogtreecommitdiff
path: root/ident.c
AgeCommit message (Collapse)AuthorFilesLines
2023-11-06Resolve some -Wsign-conversion warnings from clangAlan Coopersmith1-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-11-06Variable scope reductions as recommended by cppcheckAlan Coopersmith1-5/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-11-06ident.c: clear -Wdeclaration-after-statement warningAlan Coopersmith1-7/+8
ident.c: In function ‘getInt32’: ident.c:228:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] 228 | unsigned int u[4] = { c[0], c[1], c[2], c[3] }; | ^~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-11-04Convert to X.Org standard code styleAlan Coopersmith1-126/+144
Mostly via util/modular/x-indent-all.sh, plus some manual cleanup Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-25Remove "All rights reserved" from Oracle copyright noticesAlan Coopersmith1-1/+1
Oracle no longer includes this term in our copyright & license notices. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-03Address s UBSan warning about int left shift overflowJeremy Huddleston Sequoia1-2/+4
ident.c:220:22: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2019-01-06Clear some -Wshorten-64-to-32 warnings from clang 6Alan Coopersmith1-6/+7
ident.c:84:13: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int n = strlen(filename); ~ ^~~~~~~~~~~~~~~~ ident.c:130:9: warning: implicit conversion loses integer precision: 'off64_t' (aka 'long') to 'int' [-Wshorten-64-to-32] return gzseek(ff->f.gz, offset, whence); ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ident.c:140:17: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] n = offset - ff->pos; ~ ~~~~~~~^~~~~~~~~ ident.c:143:10: warning: implicit conversion loses integer precision: 'off_t' (aka 'long') to 'int' [-Wshorten-64-to-32] n = offset; ~ ^~~~~~ ident.c:156:12: warning: implicit conversion loses integer precision: 'off_t' (aka 'long') to 'unsigned int' [-Wshorten-64-to-32] ff->pos = offset; ~ ^~~~~~ ident.c:157:9: warning: implicit conversion loses integer precision: 'off_t' (aka 'long') to 'int' [-Wshorten-64-to-32] return offset; ~~~~~~ ^~~~~~ mkfontscale.c:704:13: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int n = strlen(dirname); ~ ^~~~~~~~~~~~~~~ mkfontscale.c:748:13: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int n = strlen(filename); ~ ^~~~~~~~~~~~~~~~ mkfontscale.c:794:14: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] xl = strlen (exclusionSuffix); ~ ^~~~~~~~~~~~~~~~~~~~~~~~ mkfontscale.c:796:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] i = strlen(dirname_given); ~ ^~~~~~~~~~~~~~~~~~~~~ mkfontscale.c:858:15: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int dl = strlen (entry->d_name); ~~ ^~~~~~~~~~~~~~~~~~~~~~ mkfontscale.c:930:21: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int l = strlen(xlfd_name); ~ ^~~~~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-09-18mkfontscale: Avoid a buffer underrunJeremy Huddleston Sequoia1-1/+1
https://bugs.freedesktop.org/show_bug.cgi?id=96905 ================================================================= ==3068==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60300000de6f at pc 0x000109df79d1 bp 0x7fff55e37d90 sp 0x7fff55e37550 READ of size 1 at 0x60300000de6f thread T0 #0 0x109df79d0 in wrap_strcmp (libclang_rt.asan_osx_dynamic.dylib+0xe9d0) #1 0x109dc8ef7 in fontFileOpen (mkfontscale+0x100001ef7) #2 0x109dc8e0b in bitmapIdentify (mkfontscale+0x100001e0b) #3 0x109dcc874 in doDirectory (mkfontscale+0x100005874) #4 0x109dcbc78 in main (mkfontscale+0x100004c78) #5 0x7fff9083f5ac in start (libdyld.dylib+0x35ac) #6 0x3 (<unknown module>) 0x60300000de6f is located 1 bytes to the left of 20-byte region [0x60300000de70,0x60300000de84) allocated by thread T0 here: #0 0x109e34570 in wrap_malloc (libclang_rt.asan_osx_dynamic.dylib+0x4b570) #1 0x109dca92a in dsprintf (mkfontscale+0x10000392a) #2 0x109dcc788 in doDirectory (mkfontscale+0x100005788) #3 0x109dcbc78 in main (mkfontscale+0x100004c78) #4 0x7fff9083f5ac in start (libdyld.dylib+0x35ac) #5 0x3 (<unknown module>) Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-06-06Protect config.h inclusion like usual.Thomas Klausner1-0/+2
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-19Replace malloc(strlen);strcpy() calls with strdupAlan Coopersmith1-2/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-04Strip trailing whitespaceAlan Coopersmith1-5/+5
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-10-29Sun's copyrights now belong to OracleAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-10-06Purge cvs tags.Jesse Adkins1-1/+0
Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
2010-01-14Update Sun license notices to current X.Org standard formAlan Coopersmith1-23/+18
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2008-11-05Add support for bzip2 compressed fonts if configured --with-bzip2Alan Coopersmith1-48/+175
2008-04-24Compile warning fixes.Paulo Cesar Pereira de Andrade1-0/+1
Include headers for proper prototypes and "ansify" makeHashTable. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2004-04-23Merging XORG-CURRENT into trunkrel-0-6-1lg3d-rel-0-7-0lg3d-baseXORG-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-MERGEEgbert Eich1-1/+1
2004-03-14Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich1-1/+1
2004-03-03Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0Egbert Eich1-1/+1
2004-02-26readding XFree86's cvs IDsxf86-4_3_99_903Egbert Eich1-1/+1
2004-02-26Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004Egbert Eich1-1/+1
2003-11-25Initial revisionXORG-STABLEKaleb Keithley1-0/+330