hotspot/src/share/vm/adlc/filebuff.cpp

Print this page
rev 611 : Merge

*** 1,10 **** #ifdef USE_PRAGMA_IDENT_SRC #pragma ident "@(#)filebuff.cpp 1.30 07/05/05 17:05:01 JVM" #endif /* ! * Copyright 1997-2002 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,10 ---- #ifdef USE_PRAGMA_IDENT_SRC #pragma ident "@(#)filebuff.cpp 1.30 07/05/05 17:05:01 JVM" #endif /* ! * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 42,51 **** --- 42,52 ---- if (_err) { file_error(SEMERR, 0, "File seek error reading input file\n"); exit(1); // Exit on seek error } _filepos = ftell(_fp->_fp); // Reset current file position + _linenum = 0; _bigbuf = new char[_bufferSize]; // Create buffer to hold text for parser if( !_bigbuf ) { file_error(SEMERR, 0, "Buffer allocation failed\n"); exit(1); // Exit on allocation failure
*** 77,86 **** --- 78,88 ---- char *retval; // Check for end of file & return NULL if (_bufeol >= _bufmax) return NULL; + _linenum++; retval = ++_bufeol; // return character following end of previous line if (*retval == '\0') return NULL; // Check for EOF sentinal // Search for newline character which must end each line for(_filepos++; *_bufeol != '\n'; _bufeol++) _filepos++; // keep filepos in sync with _bufeol