Commit f6ed58d1 authored by Sandro Santilli's avatar Sandro Santilli

Style only change: remove trailing whitespaces

git-svn-id: http://svn.osgeo.org/postgis/trunk@14869 b70326c6-7e19-0410-871a-916f4a2858ee
parent de88ae40
Pipeline #2344635 failed with stage
This diff is collapsed.
/* -- err_param.c
/* -- err_param.c
This file handles the buffering and output of errors
......@@ -39,7 +39,7 @@ static int turn_off_error_log( ERR_PARAM * ) ;
err_mem = err_p -> err_array ; \
err_p -> error_buf = err_mem -> content_buf ; \
err_mem -> is_fatal = TRUE ; \
BLANK_STRING( err_mem -> content_buf )
BLANK_STRING( err_mem -> content_buf )
......@@ -79,10 +79,10 @@ ERR_PARAM *init_errors( PAGC_GLOBAL *pagc_glo_p ,
log_name ) ;
#endif
return NULL ;
}
}
}
return err_p ;
}
}
/* ------------------------------------------------------------
......@@ -115,7 +115,7 @@ void close_errors( ERR_PARAM *err_p ) {
#endif
}
BLANK_STRING( err_out_buf ) ;
}
}
FREE_AND_NULL( err_p ) ;
}
......@@ -127,8 +127,8 @@ stdio.h (fclose)
static int turn_off_error_log( ERR_PARAM *err_p ) {
ERR_REC *err_mem ;
if ( ( err_p == NULL ) ||
( err_p -> stream == NULL ) ) {
if ( ( err_p == NULL ) ||
( err_p -> stream == NULL ) ) {
return FALSE ;
}
fclose( err_p -> stream ) ;
......@@ -140,7 +140,7 @@ static int turn_off_error_log( ERR_PARAM *err_p ) {
/* ----------------------------------------------------------
err_param.c (empty_errors)
calls : err_param.c (turn_off_error_log)
returns FALSE when all errors have been reported.
returns FALSE when all errors have been reported.
TRUE otherwise
------------------------------------------------------------*/
int empty_errors( ERR_PARAM *err_p ,
......@@ -168,7 +168,7 @@ int empty_errors( ERR_PARAM *err_p ,
err_mem = err_p -> err_array + err_p -> first_err ;
append_string_to_max( err_dest ,
err_mem -> content_buf ,
MAXSTRLEN ) ;
MAXSTRLEN ) ;
*is_fatal = err_mem -> is_fatal ;
/* -- update the low mark -- */
......@@ -219,7 +219,7 @@ void register_error( ERR_PARAM *err_p ) {
if ( strlen( err_p -> error_buf ) > MAXSTRLEN ) {
#ifndef NO_STDERR_OUTPUT
PRINT_ERROR( "Error message %s is too long" ,
err_p -> error_buf ) ;
err_p -> error_buf ) ;
#endif
return ;
}
......@@ -253,16 +253,16 @@ void register_error( ERR_PARAM *err_p ) {
}
} else {
/* -- last_err points to the next one to fill -- */
err_p -> last_err ++ ;
err_p -> last_err ++ ;
err_mem = err_p -> err_array + err_p -> last_err ;
}
/* -- reset error_buf to the new content_buf -- */
err_p -> error_buf = err_mem -> content_buf ;
err_p -> error_buf = err_mem -> content_buf ;
BLANK_STRING( err_mem -> content_buf ) ;
err_p -> next_fatal = TRUE ;
return ;
}
}
/*==========================================
......
/* -- export.c
/* -- export.c
This file contains the routines for extracting the sequence of
postal attributes and definitions produced by the standardizer
......@@ -28,11 +28,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SO
#define ORDER_DISPLACEMENT 2
/* -- local prototypes -- */
static void _copy_standard_( STAND_PARAM * , SYMB , int , int ) ;
static void _scan_target_( STAND_PARAM * , SYMB , int ) ;
static void _copy_standard_( STAND_PARAM * , SYMB , int , int ) ;
static void _scan_target_( STAND_PARAM * , SYMB , int ) ;
static char *_get_standard_( STAND_PARAM * , int , int ) ;
static char *_get_definition_text_( STAND_PARAM * , int ) ;
//#ifndef BUILD_API
/* -- local storage -- */
......@@ -116,8 +116,8 @@ void init_output_fields( STAND_PARAM *__stand_param__ , int which_fields )
{
__standard_fields__[i][0] = SENTINEL ;
}
}
else
}
else
{
/*-- Clean only one set --*/
if ( which_fields == RIGHT )
......@@ -127,8 +127,8 @@ void init_output_fields( STAND_PARAM *__stand_param__ , int which_fields )
{
__standard_fields__[i][0] = SENTINEL ;
}
}
else
}
else
{
/*-- Erase the micro fields only --*/
for ( i = BLDNG ; i < CITY ; i++ )
......@@ -174,12 +174,12 @@ static char *_get_definition_text_( STAND_PARAM *__stand_param__ , int lex_pos )
export.c (stuff_fields)
--calls export.c (_scan_target_)
-------------------------------------------*/
void stuff_fields( STAND_PARAM *__stand_param__ )
void stuff_fields( STAND_PARAM *__stand_param__ )
{
int fld ;
/*-- Translate the symbols and definitions of the standardization into
the __standard_fields__ for output --*/
for (fld = 0 ;fld < NEEDHEAD ;fld++)
for (fld = 0 ;fld < NEEDHEAD ;fld++)
{
/*-- Fields that correspond one to one with the symbols --*/
_scan_target_(__stand_param__ ,fld,fld) ;
......@@ -207,8 +207,8 @@ void send_fields_to_stream( char **__standard_fields__ , FILE *__dest_file__ , i
if (__dest_file__ != NULL)
{
fprintf(__dest_file__,"%s\n",(is_landmark? __landmark_record_start_tag__[opt] : __record_start_tag__[opt])) ;
}
else
}
else
{
printf("%s\n",(is_landmark? __landmark_record_start_tag__[opt] : __record_start_tag__[opt])) ;
}
......@@ -241,8 +241,8 @@ void send_fields_to_stream( char **__standard_fields__ , FILE *__dest_file__ , i
default :
__source_start_tag__ = ( char * ) __field_start_tag__[loc][opt] ;
}
}
else
}
else
{
__source_start_tag__ = (char *) __field_start_tag__[loc][opt] ;
}
......@@ -269,7 +269,7 @@ void send_fields_to_stream( char **__standard_fields__ , FILE *__dest_file__ , i
__source_end_tag__ = ( char * ) __field_tag_end__[ loc ][ opt ] ;
}
}
else
else
{
__source_end_tag__ = ( char * ) __field_tag_end__[ loc ][ opt ] ;
}
......@@ -278,20 +278,20 @@ void send_fields_to_stream( char **__standard_fields__ , FILE *__dest_file__ , i
if ( __dest_file__ != NULL )
{
fprintf( __dest_file__ , "%s" , __line_buf__ ) ;
}
else
}
else
{
printf( "%s" , __line_buf__ ) ;
}
}
}
if ( opt < NO_FORMAT )
if ( opt < NO_FORMAT )
{
if ( __dest_file__ != NULL )
if ( __dest_file__ != NULL )
{
fprintf( __dest_file__ , "%s\n", ( is_landmark? __landmark_record_end_tag__[ opt ] : __record_end_tag__[ opt ]));
}
else
}
else
{
printf( "%s\n" , ( is_landmark? __landmark_record_end_tag__[ opt ] : __record_end_tag__[ opt ] ) );
}
......@@ -299,8 +299,8 @@ void send_fields_to_stream( char **__standard_fields__ , FILE *__dest_file__ , i
if ( __dest_file__ != NULL )
{
fflush( __dest_file__ ) ;
}
else
}
else
{
fflush( stdout ) ;
}
......@@ -331,7 +331,7 @@ static char *_get_standard_(STAND_PARAM *__stand_param__ ,int lex_pos, int outpu
{
if (__scan_DEF__->Type == ORD)
{
if ((__selected_standardization__ = __scan_DEF__->Standard) != NULL)
if ((__selected_standardization__ = __scan_DEF__->Standard) != NULL)
{
return (__selected_standardization__) ;
}
......@@ -353,10 +353,10 @@ static char *_get_standard_(STAND_PARAM *__stand_param__ ,int lex_pos, int outpu
char *__zero_pointer__ ;
char *__buffer_pointer__ = __zero_pointer__ = __selected_standardization__ ;
while ( *__zero_pointer__ == '0' ) __zero_pointer__++ ; /*-- Move to first nonzero character --*/
while ( *__zero_pointer__ != SENTINEL ) *__buffer_pointer__++ = *__zero_pointer__++ ; /*-- Move down in buffer --*/
while ( *__zero_pointer__ != SENTINEL ) *__buffer_pointer__++ = *__zero_pointer__++ ; /*-- Move down in buffer --*/
/*-- Trim down all-zeroes to a single zero: if deleting all
the zeros leaves an empty buffer, put a zero back --*/
if ( __buffer_pointer__ == __selected_standardization__ ) *__buffer_pointer__++ = '0' ;
if ( __buffer_pointer__ == __selected_standardization__ ) *__buffer_pointer__++ = '0' ;
BLANK_STRING( __buffer_pointer__ ) ;
}
return ( __selected_standardization__ ) ;
......@@ -364,7 +364,7 @@ static char *_get_standard_(STAND_PARAM *__stand_param__ ,int lex_pos, int outpu
/*-----------------------------------------
export.c (_scan_target_ )
-- calls export.c (_copy_standard_)
-- calls export.c (_copy_standard_)
-- called by export.c (stuff_fields)
-------------------------------------------*/
static void _scan_target_(STAND_PARAM *__stand_param__,SYMB sym , int dest)
......@@ -387,11 +387,11 @@ static void _scan_target_(STAND_PARAM *__stand_param__,SYMB sym , int dest)
}
/*-----------------------------------------
export.c (_copy_standard_)
-- called by export.c (_scan_target_) --
--calls export.c (_get_standard_,
strlen, strcpy
uses macro SPACE_APPEND_WITH_LEN
export.c (_copy_standard_)
-- called by export.c (_scan_target_) --
--calls export.c (_get_standard_,
strlen, strcpy
uses macro SPACE_APPEND_WITH_LEN
-------------------------------------------*/
static void _copy_standard_( STAND_PARAM *__stand_param__ , SYMB output_sym , int fld , int lex_pos )
{
......@@ -407,7 +407,7 @@ static void _copy_standard_( STAND_PARAM *__stand_param__ , SYMB output_sym , in
if ( *__dest_buf__ != SENTINEL )
{
SPACE_APPEND_WITH_LEN( __dest_buf__ , __stan_str__ , MAXFLDLEN ) ;
}
}
else if ( output_sym == UNITT )
{
/*-- If the unit id type is missing, one needs to be provided.
......@@ -418,13 +418,13 @@ static void _copy_standard_( STAND_PARAM *__stand_param__ , SYMB output_sym , in
strcpy( __dest_buf__ , "# " ) ; /* -- reconsider this -- */
append_string_to_max( __dest_buf__ , __stan_str__ , MAXFLDLEN ) ;
}
}
else if ( output_sym == BOXT )
{
strcpy( __dest_buf__, "BOX " ) ;
append_string_to_max( __dest_buf__ , __stan_str__ ,MAXFLDLEN ) ;
}
else
}
else
{
strcpy( __dest_buf__ , __stan_str__ ) ;
}
......
This diff is collapsed.
/* -- lexicon.c
/* -- lexicon.c
This file reads the lexicon definitions into a chained
hash table and handles the lookups of words in the hash table,
......@@ -40,7 +40,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/* -- local prototypes -- */
static unsigned calc_hash( char * ) ;
static ENTRY **create_hash_table( ERR_PARAM * ) ;
static ENTRY **create_hash_table( ERR_PARAM * ) ;
static int add_dict_entry( ERR_PARAM *, ENTRY ** , char * , int , SYMB , char * ) ;
#ifndef BUILD_API
......@@ -49,7 +49,7 @@ static int read_lexicon( ERR_PARAM *, ENTRY ** , FILE * ) ;
#endif
LEXICON *lex_init( ERR_PARAM *err_p ) ;
static int append_new_def( ERR_PARAM *, ENTRY * , SYMB , char * , int ) ;
static int append_new_def( ERR_PARAM *, ENTRY * , SYMB , char * , int ) ;
static unsigned elf_hash( char * ) ;
void print_lexicon( ENTRY ** hash_table ) ;
......@@ -111,9 +111,9 @@ ENTRY **create_lexicon( PAGC_GLOBAL *glo_p ,
const char *gaz_name ) {
/* -- called by init_stand_process to read in the Lexicon and set up the
definitions in memory for hash table access -- */
FILE *gaz_file ,
FILE *gaz_file ,
*dict_file ;
ENTRY **hash_table ;
ENTRY **hash_table ;
if ( (hash_table = create_hash_table( glo_p -> process_errors ) ) == NULL ) {
return NULL ;
......@@ -122,9 +122,9 @@ ENTRY **create_lexicon( PAGC_GLOBAL *glo_p ,
if ( gaz_name != NULL ) {
if ( ( gaz_file = open_aux_file( glo_p ,
gaz_name ) ) == NULL )
return NULL ;
return NULL ;
if ( !read_lexicon( glo_p -> process_errors ,
hash_table ,
hash_table ,
gaz_file ) ) {
fclose( gaz_file ) ;
return NULL ;
......@@ -136,7 +136,7 @@ ENTRY **create_lexicon( PAGC_GLOBAL *glo_p ,
lex_name ) ) == NULL )
return NULL ;
if ( !read_lexicon( glo_p -> process_errors ,
hash_table ,
hash_table ,
dict_file ) ) {
fclose( dict_file ) ;
return NULL ;
......@@ -148,13 +148,13 @@ ENTRY **create_lexicon( PAGC_GLOBAL *glo_p ,
/* ----------------------------------------------------
lexicon.c (read_lexicon) -
called by lexicon.c (create_lexicon) for each file
calls convert_field, add_dict_entry
calls convert_field, add_dict_entry
returns FALSE if error encountered
stdio.h (fgets,feof,sscanf)
uses macro BLANK_STRING
-------------------------------------------------------*/
static int read_lexicon( ERR_PARAM *err_p ,
ENTRY **hash_table ,
ENTRY **hash_table ,
FILE *CFile ) {
char record_buffer[ MAXSTRLEN ] ;
char lookup_str[ MAXTEXT ] ;
......@@ -167,8 +167,8 @@ static int read_lexicon( ERR_PARAM *err_p ,
while ( !feof( CFile ) ) {
/* -- read in each line of the csv file and add to hash table -- */
BLANK_STRING(record_buffer) ;
fgets( record_buffer ,
MAXSTRLEN ,
fgets( record_buffer ,
MAXSTRLEN ,
CFile ) ;
#ifdef SEW_NOT_SURE_IF_WE_NEED_THIS
......@@ -197,7 +197,7 @@ static int read_lexicon( ERR_PARAM *err_p ,
next_str = convert_field( standard_str ,
next_str ) ;
if ( add_dict_entry( err_p ,
hash_table ,
hash_table ,
lookup_str ,
( num_def - 1 ) ,
cur_token ,
......@@ -226,7 +226,7 @@ static char *convert_field( char *buf ,
return NULL ;
while ( ( c = *s++ ) != SENTINEL ) {
if ( c == '\"' ||
c == '\r' )
c == '\r' )
continue ; /* -- ignore quotes and carriage returns -- */
/* -- zero terminate field and record delimiters -- */
if ( c == '\n' ||
......@@ -256,7 +256,7 @@ void destroy_lexicon(ENTRY ** hash_table)
{
return ;
}
for (__i__ = 0 ;__i__ < LEXICON_HTABSIZE ;__i__++ )
for (__i__ = 0 ;__i__ < LEXICON_HTABSIZE ;__i__++ )
{
for (__E__ = hash_table[__i__] ;__E__ != NULL ;__E__ = __F__)
{
......@@ -302,7 +302,7 @@ called by lexicon.c (add_dict_entry)
calls lexicon.c (calc_hash)
string.h (strcmp)
-------------------------------------------------------*/
ENTRY *find_entry(ENTRY **hash_table,char *lookup_str)
ENTRY *find_entry(ENTRY **hash_table,char *lookup_str)
{
/* -- called to create a lexeme -- */
ENTRY *__E__ ;
......@@ -325,8 +325,8 @@ lexicon.c (elf_hash)
called by lexicon.c (calc_hash)
-------------------------------------------------------*/
static unsigned elf_hash( char *key_str ) {
unsigned h ,
g ,
unsigned h ,
g ,
c ;
h = 0 ;
......@@ -366,7 +366,7 @@ static ENTRY **create_hash_table(ERR_PARAM *err_p)
unsigned __i__ ;
ENTRY **__hash_table__ ;
PAGC_CALLOC_STRUC(__hash_table__,ENTRY *,LEXICON_HTABSIZE,err_p,NULL) ;
for (__i__ = 0 ;__i__ < LEXICON_HTABSIZE ;__i__++ )
for (__i__ = 0 ;__i__ < LEXICON_HTABSIZE ;__i__++ )
{
__hash_table__[__i__] = NULL ;
}
......@@ -381,7 +381,7 @@ uses macro PAGC_ALLOC_STRUC , PAGC_STORE_STR, RET_ERR
return ERR_FAIL if error
-------------------------------------------------------*/
static int add_dict_entry( ERR_PARAM *err_p ,
ENTRY **hash_table ,
ENTRY **hash_table ,
char *lookup_str ,
int def_num ,
SYMB t ,
......@@ -391,13 +391,13 @@ static int add_dict_entry( ERR_PARAM *err_p ,
E = find_entry( hash_table ,
lookup_str ) ;
if ( E == NULL ) {
unsigned hash_index ;
unsigned hash_index ;
PAGC_ALLOC_STRUC(E,ENTRY,err_p,ERR_FAIL);
/* -- add the Lookup string to the record -- */
PAGC_STORE_STR(E->Lookup,lookup_str,err_p,ERR_FAIL) ;
/* -- add new entry to beginning of table -- */
hash_index = calc_hash( lookup_str ) ;
hash_index = calc_hash( lookup_str ) ;
E -> Next = hash_table[ hash_index ] ; /* -- collision chain -- */
hash_table[ hash_index ] = E ;
......@@ -407,7 +407,7 @@ static int add_dict_entry( ERR_PARAM *err_p ,
FALSE ,
err_p ) ) == NULL ) {
return ERR_FAIL ;
}
}
} else {
int err_stat ;
if ( E -> DefList == NULL ) {
......@@ -437,10 +437,10 @@ static int append_new_def( ERR_PARAM *err_p ,
ENTRY *E ,
SYMB t ,
char *text ,
int def_num ) {
int def_num ) {
DEF *D,
*pd,
DEF *D,
*pd,
*cd ;
for ( cd = E -> DefList , pd = NULL ;
cd != NULL ;
......@@ -468,10 +468,10 @@ static int append_new_def( ERR_PARAM *err_p ,
}
/*--------------------------------------------------------------------
lexicon.c (create_def)
lexicon.c (create_def)
called by lexicon.c (append_new_def) tokenize.c (setup_default_defs)
allocate memory for lexicon entry.
Pflag is TRUE for default entries
Pflag is TRUE for default entries
returns NULL for allocation error
uses macro PAGC_ALLOC_STRUC, PAGC_STORE_STR
-------------------------------------------------------------------- */
......
This diff is collapsed.
/*-- pagc_common.h --
/*-- pagc_common.h --
Certain common definitions used both by the pagc library and its clients
......@@ -18,7 +18,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SO
*/
/* For pagc-0.4.0 : last revised 2010-11-08 */
#ifndef PAGC_COM_H
#define PAGC_COM_H
......@@ -57,10 +57,10 @@ strategy types
#define SITE_INTERPOLATE 1
#define INTERSECTION 2
#define ADDRESS_RANGE_2 3
#define ADDRESS_RANGE_4 4
#define ADDRESS_RANGE_4 4
#define REVERSE_SITE 5
#define REVERSE_INTERSECTION 6
#define INTERSECTION_B 7
#define REVERSE_INTERSECTION 6
#define INTERSECTION_B 7
#define CONCAT 8
#define LANDMARK_NAME 9
......
/* -- pagc_tools.c
/* -- pagc_tools.c
Various and miscellaneous functions.
......@@ -90,27 +90,27 @@ static const char *InSymbNames[] = {
"QUAD",
} ;
/* ------------------------------------------------------------
/* ------------------------------------------------------------
ISO 8859 character set may pop up in some files. After 1998
TigerLine will use them.
TigerLine will use them.
------------------------------------------------------------- */
void convert_latin_one ( char *inp ) {
unsigned char *str ;
for ( str = ( unsigned char * ) inp ;
*str != SENTINEL ;
for ( str = ( unsigned char * ) inp ;
*str != SENTINEL ;
str++ ) {
unsigned char ch ;
ch = *str ;
/* -------------------------------------------
/* -------------------------------------------
if bit 7 is set, reset bit 5 so both upper
and lower case can be done together
and lower case can be done together
--------------------------------------------- */
if ( ch & 0x80 ) {
ch &= 0xDF ;
/* -----------------------------------------
/* -----------------------------------------
reduce letters with diacritical marks to
their unmarked base letters
their unmarked base letters
------------------------------------------ */
if ( ch >= 0xC0 &&
ch <= 0xC6 )
......@@ -132,19 +132,19 @@ void convert_latin_one ( char *inp ) {
else if ( ch >= 0xdd && ch < 0xdf )
ch = 'Y' ;
else
/* -------------------------------
/* -------------------------------
just clear the top bit so it
won't gum up the edit distance
machinery
machinery
-------------------------------- */
ch &= 0x7f ;
}
*str = ch ;
}
/* ----------------------------------------------
/* ----------------------------------------------
while we're at it, add a newline to the end
because the lexical scanner likes it like that
because the lexical scanner likes it like that
----------------------------------------------- */
*str++ = '\n' ;
*str = SENTINEL ;
......@@ -158,7 +158,7 @@ void char_append( const char *div ,
return ;
/* -- skip the delimitor if dest is empty -- */
if ( *dest == SENTINEL ) {