From 674c1ef69f302980c6def35911c1ee3c4b68cef2 Mon Sep 17 00:00:00 2001 From: Reyk Floeter Date: Thu, 20 Aug 2015 16:14:26 +0200 Subject: sync CVS commitid: WDQybNKi4LiEFw8K: Change httpd(8) to use C99-style fixed-width integers (uintN_t instead of u_intN_t) and replace u_int with unsigned int. Mixing both variants is a bad style and most contributors seem to prefer this style; it also helps us to get used to it, portability, and standardization. Theoretically no binary change, except one in practice: httpd.o has a different checksum because gcc with -O2 pads/optimizes "struct privsep" differently when using "unsigned int" instead "u_int" for the affected members. "u_int" is just a typedef of "unsigned int", -O0 doesn't build the difference and clang with -O2 doesn't do it either - it is just another curiosity from gcc-land. OK semarie@ --- httpd/parse.y | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'httpd/parse.y') diff --git a/httpd/parse.y b/httpd/parse.y index cbb1374..0b79585 100644 --- a/httpd/parse.y +++ b/httpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.73 2015/07/19 05:17:27 reyk Exp $ */ +/* $OpenBSD: parse.y,v 1.75 2015/08/20 13:00:23 reyk Exp $ */ /* * Copyright (c) 2007 - 2015 Reyk Floeter @@ -1007,7 +1007,7 @@ mediaoptsl : mediastring medianames_l optsemicolon | include ; -mediastring : STRING '/' STRING { +mediastring : STRING '/' STRING { if (strlcpy(media.media_type, $1, sizeof(media.media_type)) >= sizeof(media.media_type) || @@ -1212,10 +1212,10 @@ lookup(char *s) #define MAXPUSHBACK 128 -u_char *parsebuf; -int parseindex; -u_char pushback_buffer[MAXPUSHBACK]; -int pushback_index = 0; +unsigned char *parsebuf; +int parseindex; +unsigned char pushback_buffer[MAXPUSHBACK]; +int pushback_index = 0; int lgetc(int quotec) @@ -1307,10 +1307,10 @@ findeol(void) int yylex(void) { - u_char buf[8096]; - u_char *p, *val; - int quotec, next, c; - int token; + unsigned char buf[8096]; + unsigned char *p, *val; + int quotec, next, c; + int token; top: p = buf; @@ -2091,7 +2091,7 @@ getservice(char *n) return (s->s_port); } - return (htons((u_short)llval)); + return (htons((unsigned short)llval)); } int -- cgit v1.2.3-54-g00ecf