tblcmp.c (8874) | tblcmp.c (16519) |
---|---|
1/* tblcmp - table compression routines */ 2 3/*- 4 * Copyright (c) 1990 The Regents of the University of California. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Vern Paxson. | 1/* tblcmp - table compression routines */ 2 3/*- 4 * Copyright (c) 1990 The Regents of the University of California. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Vern Paxson. |
9 * | 9 * |
10 * The United States Government has rights in this work pursuant 11 * to contract no. DE-AC03-76SF00098 between the United States 12 * Department of Energy and the University of California. 13 * 14 * Redistribution and use in source and binary forms are permitted provided 15 * that: (1) source distributions retain this entire copyright notice and 16 * comment, and (2) distributions including binaries display the following 17 * acknowledgement: ``This product includes software developed by the 18 * University of California, Berkeley and its contributors'' in the 19 * documentation or other materials provided with the distribution and in 20 * all advertising materials mentioning features or use of this software. 21 * Neither the name of the University nor the names of its contributors may 22 * be used to endorse or promote products derived from this software without 23 * specific prior written permission. 24 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 25 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 26 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 27 */ 28 | 10 * The United States Government has rights in this work pursuant 11 * to contract no. DE-AC03-76SF00098 between the United States 12 * Department of Energy and the University of California. 13 * 14 * Redistribution and use in source and binary forms are permitted provided 15 * that: (1) source distributions retain this entire copyright notice and 16 * comment, and (2) distributions including binaries display the following 17 * acknowledgement: ``This product includes software developed by the 18 * University of California, Berkeley and its contributors'' in the 19 * documentation or other materials provided with the distribution and in 20 * all advertising materials mentioning features or use of this software. 21 * Neither the name of the University nor the names of its contributors may 22 * be used to endorse or promote products derived from this software without 23 * specific prior written permission. 24 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 25 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 26 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 27 */ 28 |
29/* $Header: /home/ncvs/src/usr.bin/lex/tblcmp.c,v 1.1.1.1 1994/08/24 13:10:31 csgr Exp $ */ | 29/* $Header: /home/ncvs/src/usr.bin/lex/tblcmp.c,v 1.1.1.2 1996/06/19 20:26:43 nate Exp $ */ |
30 31#include "flexdef.h" 32 33 34/* declarations for functions that have forward references */ 35 36void mkentry PROTO((register int*, int, int, int, int)); 37void mkprot PROTO((int[], int, int)); --- 267 unchanged lines hidden (view full) --- 305 current_max_xpairs += MAX_XPAIRS_INCREMENT; 306 307 ++num_reallocs; 308 309 nxt = reallocate_integer_array( nxt, current_max_xpairs ); 310 chk = reallocate_integer_array( chk, current_max_xpairs ); 311 312 zero_out( (char *) (chk + old_max), | 30 31#include "flexdef.h" 32 33 34/* declarations for functions that have forward references */ 35 36void mkentry PROTO((register int*, int, int, int, int)); 37void mkprot PROTO((int[], int, int)); --- 267 unchanged lines hidden (view full) --- 305 current_max_xpairs += MAX_XPAIRS_INCREMENT; 306 307 ++num_reallocs; 308 309 nxt = reallocate_integer_array( nxt, current_max_xpairs ); 310 chk = reallocate_integer_array( chk, current_max_xpairs ); 311 312 zero_out( (char *) (chk + old_max), |
313 MAX_XPAIRS_INCREMENT * sizeof( int ) / sizeof( char ) ); | 313 (size_t) (MAX_XPAIRS_INCREMENT * sizeof( int )) ); |
314 } 315 316 317/* find_table_space - finds a space in the table for a state to be placed 318 * 319 * synopsis 320 * int *state, numtrans, block_start; 321 * int find_table_space(); --- 109 unchanged lines hidden (view full) --- 431 * 432 * Initializes "firstfree" to be one beyond the end of the table. Initializes 433 * all "chk" entries to be zero. 434 */ 435void inittbl() 436 { 437 register int i; 438 | 314 } 315 316 317/* find_table_space - finds a space in the table for a state to be placed 318 * 319 * synopsis 320 * int *state, numtrans, block_start; 321 * int find_table_space(); --- 109 unchanged lines hidden (view full) --- 431 * 432 * Initializes "firstfree" to be one beyond the end of the table. Initializes 433 * all "chk" entries to be zero. 434 */ 435void inittbl() 436 { 437 register int i; 438 |
439 zero_out( (char *) chk, 440 current_max_xpairs * sizeof( int ) / sizeof( char ) ); | 439 zero_out( (char *) chk, (size_t) (current_max_xpairs * sizeof( int )) ); |
441 442 tblend = 0; 443 firstfree = tblend + 1; 444 numtemps = 0; 445 446 if ( usemecs ) 447 { 448 /* Set up doubly-linked meta-equivalence classes; these --- 440 unchanged lines hidden --- | 440 441 tblend = 0; 442 firstfree = tblend + 1; 443 numtemps = 0; 444 445 if ( usemecs ) 446 { 447 /* Set up doubly-linked meta-equivalence classes; these --- 440 unchanged lines hidden --- |