Index: xc/lib/Xau/AuFileName.c =================================================================== RCS file: /cvs/xprint/xprint/src/xprint_main/xc/lib/Xau/AuFileName.c,v retrieving revision 1.1.1.1 diff -u -2 -0 -r1.1.1.1 AuFileName.c --- a/xc/lib/Xau/AuFileName.c 28 May 2002 01:40:28 -0000 1.1.1.1 +++ b/xc/lib/Xau/AuFileName.c 17 May 2004 01:12:17 -0000 @@ -11,46 +11,47 @@ documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #include #include +#include char * XauFileName () { char *slashDotXauthority = "/.Xauthority"; - char *name, *malloc (), *getenv (); + char *name; static char *buf; static int bsize; #ifdef WIN32 char dir[128]; #endif int size; if ((name = getenv ("XAUTHORITY"))) return name; name = getenv ("HOME"); if (!name) { #ifdef WIN32 (void) strcpy (dir, "/users/"); if (name = getenv("USERNAME")) { (void) strcat (dir, name); name = dir; } if (!name) #endif return 0; Index: xc/lib/Xau/AuRead.c =================================================================== RCS file: /cvs/xprint/xprint/src/xprint_main/xc/lib/Xau/AuRead.c,v retrieving revision 1.1.1.1 diff -u -2 -0 -r1.1.1.1 AuRead.c --- a/xc/lib/Xau/AuRead.c 28 May 2002 01:40:28 -0000 1.1.1.1 +++ b/xc/lib/Xau/AuRead.c 17 May 2004 01:12:17 -0000 @@ -10,89 +10,89 @@ copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #include +#include static read_short (shortp, file) unsigned short *shortp; FILE *file; { unsigned char file_short[2]; if (fread ((char *) file_short, (int) sizeof (file_short), 1, file) != 1) return 0; *shortp = file_short[0] * 256 + file_short[1]; return 1; } static read_counted_string (countp, stringp, file) unsigned short *countp; char **stringp; FILE *file; { unsigned short len; - char *data, *malloc (); + char *data; if (read_short (&len, file) == 0) return 0; if (len == 0) { data = 0; } else { data = malloc ((unsigned) len); if (!data) return 0; if (fread (data, (int) sizeof (char), (int) len, file) != len) { bzero (data, len); free (data); return 0; } } *stringp = data; *countp = len; return 1; } Xauth * XauReadAuth (auth_file) FILE *auth_file; { Xauth local; Xauth *ret; - char *malloc (); if (read_short (&local.family, auth_file) == 0) return 0; if (read_counted_string (&local.address_length, &local.address, auth_file) == 0) return 0; if (read_counted_string (&local.number_length, &local.number, auth_file) == 0) { if (local.address) free (local.address); return 0; } if (read_counted_string (&local.name_length, &local.name, auth_file) == 0) { if (local.address) free (local.address); if (local.number) free (local.number); return 0; } if (read_counted_string (&local.data_length, &local.data, auth_file) == 0) { if (local.address) free (local.address); if (local.number) free (local.number); if (local.name) free (local.name); return 0; } Index: xc/lib/Xau/AuWrite.c =================================================================== RCS file: /cvs/xprint/xprint/src/xprint_main/xc/lib/Xau/AuWrite.c,v retrieving revision 1.1.1.1 diff -u -2 -0 -r1.1.1.1 AuWrite.c --- a/xc/lib/Xau/AuWrite.c 28 May 2002 01:40:28 -0000 1.1.1.1 +++ b/xc/lib/Xau/AuWrite.c 17 May 2004 01:12:17 -0000 @@ -10,67 +10,66 @@ copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #include +#include static write_short (s, file) unsigned short s; FILE *file; { unsigned char file_short[2]; file_short[0] = (s & (unsigned)0xff00) >> 8; file_short[1] = s & 0xff; if (fwrite ((char *) file_short, (int) sizeof (file_short), 1, file) != 1) return 0; return 1; } static write_counted_string (count, string, file) unsigned short count; char *string; FILE *file; { if (write_short (count, file) == 0) return 0; if (fwrite (string, (int) sizeof (char), (int) count, file) != count) return 0; return 1; } int XauWriteAuth (auth_file, auth) FILE *auth_file; Xauth *auth; { - char *malloc (); - if (write_short (auth->family, auth_file) == 0) return 0; if (write_counted_string (auth->address_length, auth->address, auth_file) == 0) return 0; if (write_counted_string (auth->number_length, auth->number, auth_file) == 0) return 0; if (write_counted_string (auth->name_length, auth->name, auth_file) == 0) return 0; if (write_counted_string (auth->data_length, auth->data, auth_file) == 0) return 0; return 1; } Index: xc/programs/Xserver/os/utils.c =================================================================== RCS file: /cvs/xprint/xprint/src/xprint_main/xc/programs/Xserver/os/utils.c,v retrieving revision 1.4 diff -u -2 -0 -r1.4 utils.c --- a/xc/programs/Xserver/os/utils.c 8 Jul 2003 04:39:56 -0000 1.4 +++ b/xc/programs/Xserver/os/utils.c 17 May 2004 01:12:19 -0000 @@ -38,40 +38,41 @@ supporting documentation, and that the names of Digital and Quarterdeck not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL AND QUARTERDECK DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifdef WIN32 #include #endif #include "Xos.h" #include +#include #include "misc.h" #include "X.h" #include "input.h" #include "opaque.h" #ifdef X_POSIX_C_SOURCE #define _POSIX_C_SOURCE X_POSIX_C_SOURCE #include #undef _POSIX_C_SOURCE #else #if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE) #include #else #define _POSIX_SOURCE #include #undef _POSIX_SOURCE #endif #endif #ifndef WIN32 #ifndef SYSV #include @@ -860,69 +861,67 @@ return 0; #endif /* TCPCONN */ } /* XALLOC -- X's internal memory allocator. Why does it return unsigned * long * instead of the more common char *? Well, if you read K&R you'll * see they say that alloc must return a pointer "suitable for conversion" * to whatever type you really want. In a full-blown generic allocator * there's no way to solve the alignment problems without potentially * wasting lots of space. But we have a more limited problem. We know * we're only ever returning pointers to structures which will have to * be long word aligned. So we are making a stronger guarantee. It might * have made sense to make Xalloc return char * to conform with people's * expectations of malloc, but this makes lint happier. */ unsigned long * Xalloc (amount) unsigned long amount; { - char *malloc(); register pointer ptr; if ((long)amount <= 0) return (unsigned long *)NULL; /* aligned extra on long word boundary */ amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1); #ifdef MEMBUG if (!Must_have_memory && Memory_fail && ((random() % MEM_FAIL_SCALE) < Memory_fail)) return (unsigned long *)NULL; #endif if (ptr = (pointer)malloc(amount)) return (unsigned long *)ptr; if (Must_have_memory) FatalError("Out of memory"); return (unsigned long *)NULL; } /***************** * XNFalloc * "no failure" realloc, alternate interface to Xalloc w/o Must_have_memory *****************/ unsigned long * XNFalloc (amount) unsigned long amount; { - char *malloc(); register pointer ptr; if ((long)amount <= 0) { return (unsigned long *)NULL; } /* aligned extra on long word boundary */ amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1); ptr = (pointer)malloc(amount); if (!ptr) { FatalError("Out of memory"); } return ((unsigned long *)ptr); } /***************** * Xcalloc *****************/ @@ -930,43 +929,40 @@ Xcalloc (amount) unsigned long amount; { unsigned long *ret; ret = Xalloc (amount); if (ret) bzero ((char *) ret, (int) amount); return ret; } /***************** * Xrealloc *****************/ unsigned long * Xrealloc (ptr, amount) register pointer ptr; unsigned long amount; { - char *malloc(); - char *realloc(); - #ifdef MEMBUG if (!Must_have_memory && Memory_fail && ((random() % MEM_FAIL_SCALE) < Memory_fail)) return (unsigned long *)NULL; #endif if ((long)amount <= 0) { if (ptr && !amount) free(ptr); return (unsigned long *)NULL; } amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1); if (ptr) ptr = (pointer)realloc((char *)ptr, amount); else ptr = (pointer)malloc(amount); if (ptr) return (unsigned long *)ptr; if (Must_have_memory) FatalError("Out of memory");