Print this page
2944 cscope-fast/invlib.[ch] use reserved word as identifier
Reviewed by: Albert Lee <trisk@nexenta.com>
Reviewed by: Gary Mills <gary_mills@fastmail.fm>
Reviewed by: Joerg Schilling <Joerg.Schilling@fokus.fraunhofer.de>

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/cscope-fast/invlib.c
          +++ new/usr/src/tools/cscope-fast/invlib.c
↓ open down ↓ 20 lines elided ↑ open up ↑
  21   21   */
  22   22  /*      Copyright (c) 1988 AT&T */
  23   23  /*        All Rights Reserved   */
  24   24  
  25   25  
  26   26  /*
  27   27   * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  28   28   * Use is subject to license terms.
  29   29   */
  30   30  
  31      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  32      -
  33   31  #include <ctype.h>
  34   32  #include <stdio.h>
  35   33  #include <sys/types.h>
  36   34  #include <sys/sysmacros.h>
  37   35  #include <sys/byteorder.h>
  38   36  #if SHARE
  39   37  #include <sys/ipc.h>
  40   38  #include <sys/shm.h>
  41   39  #define ERR  -1
  42   40  #endif
↓ open down ↓ 898 lines elided ↑ open up ↑
 941  939  
 942  940  void
 943  941  boolclear(void)
 944  942  {
 945  943          numitems = 0;
 946  944          item = item1;
 947  945          enditem = item;
 948  946  }
 949  947  
 950  948  POSTING *
 951      -boolfile(INVCONTROL *invcntl, long *num, int bool)
      949 +boolfile(INVCONTROL *invcntl, long *num, int op)
 952  950  {
 953  951          ENTRY   *entryptr;
 954  952          FILE    *file;
 955  953          char    *ptr;
 956  954          unsigned long   *ptr2;
 957  955          POSTING *newitem;
 958  956          POSTING posting;
 959  957          unsigned u;
 960  958          POSTING *newsetp, *set1p;
 961  959          long    newsetc, set1c, set2c;
 962  960  
 963  961          entryptr = (ENTRY *) (invcntl->logblk + 12) + invcntl->keypnt;
 964  962          ptr = invcntl->logblk + entryptr->offset;
 965  963          ptr2 = ((unsigned long *)ptr) +
 966  964              (entryptr->size + (sizeof (long) - 1)) / sizeof (long);
 967  965          *num = entryptr->post;
 968      -        switch (bool) {
      966 +        switch (op) {
 969  967          case OR:
 970  968          case NOT:
 971  969                  if (*num == 0) {
 972  970                          *num = numitems;
 973  971                          return (item);
 974  972                  }
 975  973          }
 976  974          /* make room for the new set */
 977  975          u = 0;
 978      -        switch (bool) {
      976 +        switch (op) {
 979  977          case AND:
 980  978          case NOT:
 981  979                  newsetp = set1p = item;
 982  980                  break;
 983  981  
 984  982          case OR:
 985  983                  u = enditem - item;
 986  984                  /* FALLTHROUGH */
 987  985          case REVERSENOT:
 988  986                  u += *num;
↓ open down ↓ 22 lines elided ↑ open up ↑
1011 1009                          }
1012 1010                          newitem = item2;
1013 1011                  }
1014 1012                  set1p = item;
1015 1013                  newsetp = newitem;
1016 1014          }
1017 1015          file = invcntl->postfile;
1018 1016          (void) fseek(file, (long)*ptr2, SEEK_SET);
1019 1017          read_next_posting(invcntl, &posting);
1020 1018          newsetc = 0;
1021      -        switch (bool) {
     1019 +        switch (op) {
1022 1020          case OR:
1023 1021                  /* while something in both sets */
1024 1022                  set1p = item;
1025 1023                  newsetp = newitem;
1026 1024                  for (set1c = 0, set2c = 0;
1027 1025                      set1c < numitems && set2c < *num; newsetc++) {
1028 1026                          if (set1p->lineoffset < posting.lineoffset) {
1029 1027                                  *newsetp++ = *set1p++;
1030 1028                                  set1c++;
1031 1029                          } else if (set1p->lineoffset > posting.lineoffset) {
↓ open down ↓ 189 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX