diff options
Diffstat (limited to 'apps/gperf/src/List_Node.cpp')
-rw-r--r-- | apps/gperf/src/List_Node.cpp | 74 |
1 files changed, 36 insertions, 38 deletions
diff --git a/apps/gperf/src/List_Node.cpp b/apps/gperf/src/List_Node.cpp index 1668ab114c0..f828ec91dab 100644 --- a/apps/gperf/src/List_Node.cpp +++ b/apps/gperf/src/List_Node.cpp @@ -1,25 +1,27 @@ // -*- C++ -*- -// $Id$ - -// Copyright (C) 1989 Free Software Foundation, Inc. -// written by Douglas C. Schmidt (schmidt@cs.wustl.edu) - -// This file is part of GNU GPERF. - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +/** + * $Id$ + * + * Copyright (C) 1989 Free Software Foundation, Inc. + * written by Douglas C. Schmidt (schmidt@cs.wustl.edu) + * + * This file is part of GNU GPERF. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #include "List_Node.h" @@ -30,9 +32,8 @@ ACE_RCSID(src, List_Node, "$Id$") #include "Vectors.h" #include "ace/OS_NS_ctype.h" -// Sorts the key set alphabetically to speed up subsequent operation -// Uses insertion sort since the set is probably quite small. - +/// Sorts the key set alphabetically to speed up subsequent operation +/// Uses insertion sort since the set is probably quite small. inline void List_Node::sort (char *base, int len) { @@ -54,19 +55,18 @@ List_Node::sort (char *base, int len) } } -// Initializes a List_Node. This requires obtaining memory for the -// CHAR_SET initializing them using the information stored in the -// KEY_POSITIONS array in Options, and checking for simple errors. -// It's important to note that KEY and REST are both pointers to the -// different offsets into the same block of dynamic memory pointed to -// by parameter K. The data member REST is used to store any -// additional fields of the input file (it is set to the "" string if -// Option[TYPE] is not enabled). This is useful if the user wishes to -// incorporate a lookup structure, rather than just an array of keys. -// Finally, KEY_NUMBER contains a count of the total number of keys -// seen so far. This is used to initialize the INDEX field to some -// useful value. - +/// Initializes a List_Node. This requires obtaining memory for the +/// CHAR_SET initializing them using the information stored in the +/// KEY_POSITIONS array in Options, and checking for simple errors. +/// It's important to note that KEY and REST are both pointers to the +/// different offsets into the same block of dynamic memory pointed to +/// by parameter K. The data member REST is used to store any +/// additional fields of the input file (it is set to the "" string if +/// Option[TYPE] is not enabled). This is useful if the user wishes to +/// incorporate a lookup structure, rather than just an array of keys. +/// Finally, KEY_NUMBER contains a count of the total number of keys +/// seen so far. This is used to initialize the INDEX field to some +/// useful value. List_Node::List_Node (char *k, int len) : link (0), next (0), @@ -95,12 +95,10 @@ List_Node::List_Node (char *k, int len) else { // Only use those character positions specified by the user. - option.reset (); // Iterate thru the list of key_positions, initializing // occurrences table and keysig (via char * pointer ptr). - for (int i; (i = option.get ()) != EOS; ) { if (i == WORD_END) // Special notation for last KEY position, i.e. '$'. |