head 1.4; access; symbols pkgsrc-2026Q1:1.4.0.74 pkgsrc-2026Q1-base:1.4 pkgsrc-2025Q4:1.4.0.72 pkgsrc-2025Q4-base:1.4 pkgsrc-2025Q3:1.4.0.70 pkgsrc-2025Q3-base:1.4 pkgsrc-2025Q2:1.4.0.68 pkgsrc-2025Q2-base:1.4 pkgsrc-2025Q1:1.4.0.66 pkgsrc-2025Q1-base:1.4 pkgsrc-2024Q4:1.4.0.64 pkgsrc-2024Q4-base:1.4 pkgsrc-2024Q3:1.4.0.62 pkgsrc-2024Q3-base:1.4 pkgsrc-2024Q2:1.4.0.60 pkgsrc-2024Q2-base:1.4 pkgsrc-2024Q1:1.4.0.58 pkgsrc-2024Q1-base:1.4 pkgsrc-2023Q4:1.4.0.56 pkgsrc-2023Q4-base:1.4 pkgsrc-2023Q3:1.4.0.54 pkgsrc-2023Q3-base:1.4 pkgsrc-2023Q2:1.4.0.52 pkgsrc-2023Q2-base:1.4 pkgsrc-2023Q1:1.4.0.50 pkgsrc-2023Q1-base:1.4 pkgsrc-2022Q4:1.4.0.48 pkgsrc-2022Q4-base:1.4 pkgsrc-2022Q3:1.4.0.46 pkgsrc-2022Q3-base:1.4 pkgsrc-2022Q2:1.4.0.44 pkgsrc-2022Q2-base:1.4 pkgsrc-2022Q1:1.4.0.42 pkgsrc-2022Q1-base:1.4 pkgsrc-2021Q4:1.4.0.40 pkgsrc-2021Q4-base:1.4 pkgsrc-2021Q3:1.4.0.38 pkgsrc-2021Q3-base:1.4 pkgsrc-2021Q2:1.4.0.36 pkgsrc-2021Q2-base:1.4 pkgsrc-2021Q1:1.4.0.34 pkgsrc-2021Q1-base:1.4 pkgsrc-2020Q4:1.4.0.32 pkgsrc-2020Q4-base:1.4 pkgsrc-2020Q3:1.4.0.30 pkgsrc-2020Q3-base:1.4 pkgsrc-2020Q2:1.4.0.26 pkgsrc-2020Q2-base:1.4 pkgsrc-2020Q1:1.4.0.6 pkgsrc-2020Q1-base:1.4 pkgsrc-2019Q4:1.4.0.28 pkgsrc-2019Q4-base:1.4 pkgsrc-2019Q3:1.4.0.24 pkgsrc-2019Q3-base:1.4 pkgsrc-2019Q2:1.4.0.22 pkgsrc-2019Q2-base:1.4 pkgsrc-2019Q1:1.4.0.20 pkgsrc-2019Q1-base:1.4 pkgsrc-2018Q4:1.4.0.18 pkgsrc-2018Q4-base:1.4 pkgsrc-2018Q3:1.4.0.16 pkgsrc-2018Q3-base:1.4 pkgsrc-2018Q2:1.4.0.14 pkgsrc-2018Q2-base:1.4 pkgsrc-2018Q1:1.4.0.12 pkgsrc-2018Q1-base:1.4 pkgsrc-2017Q4:1.4.0.10 pkgsrc-2017Q4-base:1.4 pkgsrc-2017Q3:1.4.0.8 pkgsrc-2017Q3-base:1.4 pkgsrc-2017Q2:1.4.0.4 pkgsrc-2017Q2-base:1.4 pkgsrc-2017Q1:1.4.0.2 pkgsrc-2017Q1-base:1.4 pkgsrc-2016Q4:1.3.0.28 pkgsrc-2016Q4-base:1.3 pkgsrc-2016Q3:1.3.0.26 pkgsrc-2016Q3-base:1.3 pkgsrc-2016Q2:1.3.0.24 pkgsrc-2016Q2-base:1.3 pkgsrc-2016Q1:1.3.0.22 pkgsrc-2016Q1-base:1.3 pkgsrc-2015Q4:1.3.0.20 pkgsrc-2015Q4-base:1.3 pkgsrc-2015Q3:1.3.0.18 pkgsrc-2015Q3-base:1.3 pkgsrc-2015Q2:1.3.0.16 pkgsrc-2015Q2-base:1.3 pkgsrc-2015Q1:1.3.0.14 pkgsrc-2015Q1-base:1.3 pkgsrc-2014Q4:1.3.0.12 pkgsrc-2014Q4-base:1.3 pkgsrc-2014Q3:1.3.0.10 pkgsrc-2014Q3-base:1.3 pkgsrc-2014Q2:1.3.0.8 pkgsrc-2014Q2-base:1.3 pkgsrc-2014Q1:1.3.0.6 pkgsrc-2014Q1-base:1.3 pkgsrc-2013Q4:1.3.0.4 pkgsrc-2013Q4-base:1.3 pkgsrc-2013Q3:1.3.0.2 pkgsrc-2013Q3-base:1.3 pkgsrc-2013Q2:1.2.0.60 pkgsrc-2013Q2-base:1.2 pkgsrc-2013Q1:1.2.0.58 pkgsrc-2013Q1-base:1.2 pkgsrc-2012Q4:1.2.0.56 pkgsrc-2012Q4-base:1.2 pkgsrc-2012Q3:1.2.0.54 pkgsrc-2012Q3-base:1.2 pkgsrc-2012Q2:1.2.0.52 pkgsrc-2012Q2-base:1.2 pkgsrc-2012Q1:1.2.0.50 pkgsrc-2012Q1-base:1.2 pkgsrc-2011Q4:1.2.0.48 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q3:1.2.0.46 pkgsrc-2011Q3-base:1.2 pkgsrc-2011Q2:1.2.0.44 pkgsrc-2011Q2-base:1.2 pkgsrc-2011Q1:1.2.0.42 pkgsrc-2011Q1-base:1.2 pkgsrc-2010Q4:1.2.0.40 pkgsrc-2010Q4-base:1.2 pkgsrc-2010Q3:1.2.0.38 pkgsrc-2010Q3-base:1.2 pkgsrc-2010Q2:1.2.0.36 pkgsrc-2010Q2-base:1.2 pkgsrc-2010Q1:1.2.0.34 pkgsrc-2010Q1-base:1.2 pkgsrc-2009Q4:1.2.0.32 pkgsrc-2009Q4-base:1.2 pkgsrc-2009Q3:1.2.0.30 pkgsrc-2009Q3-base:1.2 pkgsrc-2009Q2:1.2.0.28 pkgsrc-2009Q2-base:1.2 pkgsrc-2009Q1:1.2.0.26 pkgsrc-2009Q1-base:1.2 pkgsrc-2008Q4:1.2.0.24 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.2.0.22 pkgsrc-2008Q3-base:1.2 cube-native-xorg:1.2.0.20 cube-native-xorg-base:1.2 pkgsrc-2008Q2:1.2.0.18 pkgsrc-2008Q2-base:1.2 cwrapper:1.2.0.16 pkgsrc-2008Q1:1.2.0.14 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.2.0.12 pkgsrc-2007Q4-base:1.2 pkgsrc-2007Q3:1.2.0.10 pkgsrc-2007Q3-base:1.2 pkgsrc-2007Q2:1.2.0.8 pkgsrc-2007Q2-base:1.2 pkgsrc-2007Q1:1.2.0.6 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.4 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.2.0.2 pkgsrc-2006Q3-base:1.2; locks; strict; comment @# @; 1.4 date 2017.02.18.13.57.37; author joerg; state Exp; branches; next 1.3; commitid ciPFgNGZ0KwyhrGz; 1.3 date 2013.09.10.14.44.28; author joerg; state Exp; branches; next 1.2; commitid fDtqzCawd6eHWT4x; 1.2 date 2006.08.04.22.59.02; author rillig; state Exp; branches; next 1.1; 1.1 date 2006.08.04.22.46.27; author rillig; state Exp; branches; next ; desc @@ 1.4 log @Fix zlib fallout. @ text @$NetBSD: patch-ac,v 1.3 2013/09/10 14:44:28 joerg Exp $ --- same.c.orig 2004-07-16 17:30:01.000000000 +0000 +++ same.c @@@@ -106,10 +106,9 @@@@ * - There is a 1024 (BUFSIZE) character limit to pathnames when using * symlinks. * - * - The same source is not exactly 32kbytes long. However this comment - * seems to fix that. * */ +#define _FILE_OFFSET_BITS 64 #include #include @@@@ -123,16 +122,8 @@@@ #include #include #include - -#define __USE_LARGEFILE64 #include -#if 1 -/* Why the *&^#$ doesn't sys/stat define this??? */ -extern int lstat64 (__const char *__restrict __file, - struct stat64 *__restrict __buf) __THROW; -#endif - #ifdef __linux__ #include #else /* !__linux__ */ @@@@ -157,6 +148,11 @@@@ extern int lstat64 (__const char *__rest #define true 1 #define false 0 +#if defined(__GNUC__) +# define attribute_unused __attribute__((__unused__)) +#else +# define attribute_unused /**/ +#endif static volatile int stop; static volatile int doing_input; @@@@ -184,7 +180,7 @@@@ static const char *o_cache; struct name_entry { struct name_entry *next; - char name[0]; + char name[1]; }; #define F_CRC_VALID (1 << 0) @@@@ -196,7 +192,7 @@@@ struct inode_entry { struct name_entry *names; int flags; /* See F_* definitions above */ /* The two fields below may have been read from the cache */ - loff_t size; + off_t size; unsigned int crc; /* valid if flags & F_CRC_VALID only */ /* The four fields below are valid if flags & F_STAT_VALID only */ dev_t device; @@@@ -265,7 +261,7 @@@@ static void dump_inode_entry(const struc static void dump_hashtable(void); static void load_cache(void); static void save_cache(void); -static void save_entry(gzFile *out, const struct inode_entry *entry); +static void save_entry(gzFile out, const struct inode_entry *entry); static void *p_malloc(unsigned int hash, size_t size); static struct inode_entry *alloc_inode_entry(unsigned int hash, int is_new); static void delete_inode_entry(struct inode_entry *entry); @@@@ -288,7 +284,7 @@@@ static void read_list(void); static const char *get_fname(void); static struct inode_entry *get_entry(void); static int __get_stat(struct inode_entry *entry); -static unsigned int calc_hash(const struct stat64 *sb); +static unsigned int calc_hash(const struct stat *sb); static int __get_crc(struct inode_entry *entry); static int cmp(const struct inode_entry *entry1, const struct inode_entry *entry2); @@@@ -379,7 +375,7 @@@@ static void dump_inode_entry(const struc printf("%sentry %p size %lu crc %08x device %lx inode %lx nlink %d uid " "%lx\n", - indent, entry, (unsigned long)entry->size, entry->crc, + indent, (void *)entry, (unsigned long)entry->size, entry->crc, (unsigned long)entry->device, (unsigned long)entry->inode, entry->nlink, (unsigned long)entry->uid); for (names = entry->names; names; names = names->next) @@@@ -426,10 +422,10 @@@@ static inline int is_new(const struct in static void load_cache(void) { static char buf[BUFSIZE]; - gzFile *in; + gzFile in; unsigned long line = 0; char *s; - loff_t size; + off_t size; unsigned int crc; const char *name; unsigned int hash = 0; @@@@ -505,7 +501,7 @@@@ static void *Malloc (size_t size) static void save_cache(void) { struct stat sb; - gzFile *out; + gzFile out; unsigned int i; struct inode_entry *entry; char backup[PATH_MAX+1], tmpname[PATH_MAX+1]; @@@@ -563,7 +559,7 @@@@ static void save_cache(void) * Save a cache entry */ -static void save_entry(gzFile *out, const struct inode_entry *entry) +static void save_entry(gzFile out, const struct inode_entry *entry) { const struct name_entry *names; @@@@ -587,7 +583,7 @@@@ static void *p_malloc(unsigned int hash, void *data; if (size > sizeof(pool->data)) { - fprintf(stderr, "Warning: p_malloc() of size %u\n", size); + fprintf(stderr, "Warning: p_malloc() of size %zu\n", size); return malloc(size); } @@@@ -659,7 +655,7 @@@@ static struct name_entry *alloc_name_ent return entry; } -static void delete_name_entry(struct name_entry *entry __attribute__((__unused__))) +static void delete_name_entry(struct name_entry *entry attribute_unused) { /* * We don't free names allocated from the pool @@@@ -1168,7 +1164,7 @@@@ static struct inode_entry *get_entry(voi { const char *buf; struct inode_entry *entry; - struct stat64 sb; + struct stat sb; unsigned int hash; do { @@@@ -1176,7 +1172,7 @@@@ static struct inode_entry *get_entry(voi if (buf == NULL) return NULL; stat_stat++; - if (lstat64(buf, &sb) < 0) { + if (lstat(buf, &sb) < 0) { fprintf(stderr, "stat %s: %s\n", buf, strerror(errno)); exit(1); } @@@@ -1204,13 +1200,13 @@@@ static struct inode_entry *get_entry(voi static int __get_stat(struct inode_entry *entry) { - struct stat64 sb; + struct stat sb; struct name_entry *name; /* Loop until we find a file that does exist */ while ((name = entry->names) != 0) { stat_stat++; - if (lstat64(name->name, &sb) < 0) + if (lstat(name->name, &sb) < 0) fprintf(stderr, "stat %s: %s\n", name->name, strerror(errno)); else if (S_ISREG(sb.st_mode)) { entry->device = sb.st_dev; @@@@ -1231,7 +1227,7 @@@@ static int __get_stat(struct inode_entry * Calculate the Hash Value for an Inode Entry */ -static unsigned int calc_hash(const struct stat64 *sb) +static unsigned int calc_hash(const struct stat *sb) { return (sb->st_size) % MAXHASH; } @@@@ -1256,7 +1252,7 @@@@ static int __get_crc(struct inode_entry } while ((n = read(f1, b1, BUFSIZE)) > 0) - crc = crc32(crc, b1, n); + crc = crc32(crc, (void *)b1, n); close(f1); if (n < 0) { fprintf(stderr, "read %s: %s\n", entry->names->name, strerror(errno)); @ 1.3 log @Use z modifier for size_t. @ text @d1 1 a1 1 $NetBSD: patch-ac,v 1.2 2006/08/04 22:59:02 rillig Exp $ d64 9 d91 6 a96 2 @@@@ -429,7 +425,7 @@@@ static void load_cache(void) gzFile *in; d104 18 @ 1.2 log @Ported to Solaris 8. @ text @d1 1 a1 1 $NetBSD: patch-ac,v 1.1 2006/08/04 22:46:27 rillig Exp $ d3 2 a4 2 --- same.c.orig 2004-07-16 19:30:01.000000000 +0200 +++ same.c 2006-08-05 00:57:39.680842400 +0200 d91 9 @ 1.1 log @Updated same to 1.8. Changes unknown. @ text @d1 1 a1 1 $NetBSD$ d4 1 a4 1 +++ same.c 2006-08-05 00:17:54.000000000 +0200 d34 13 a46 1 @@@@ -184,7 +175,7 @@@@ static const char *o_cache; d55 1 a55 1 @@@@ -196,7 +187,7 @@@@ struct inode_entry { d64 1 a64 1 @@@@ -288,7 +279,7 @@@@ static void read_list(void); d73 1 a73 1 @@@@ -379,7 +370,7 @@@@ static void dump_inode_entry(const struc d82 1 a82 1 @@@@ -429,7 +420,7 @@@@ static void load_cache(void) d91 10 a100 1 @@@@ -1168,7 +1159,7 @@@@ static struct inode_entry *get_entry(voi d109 1 a109 1 @@@@ -1176,7 +1167,7 @@@@ static struct inode_entry *get_entry(voi d118 1 a118 1 @@@@ -1204,13 +1195,13 @@@@ static struct inode_entry *get_entry(voi d134 1 a134 1 @@@@ -1231,7 +1222,7 @@@@ static int __get_stat(struct inode_entry d143 1 a143 1 @@@@ -1256,7 +1247,7 @@@@ static int __get_crc(struct inode_entry @