~ubuntu-branches/ubuntu/maverick/swig1.3/maverick

« back to all changes in this revision

Viewing changes to Source/DOH/hash.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-11-10 16:29:56 UTC
  • mfrom: (1.2.8 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20081110162956-xue6itkuqhbza87s
Tags: 1.3.36-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop pike and libchicken-dev from the build-depends 
    (both are universe)
  - Use python2.5 instead of python2.4.
  - use php5
  - Clean Runtime/ as well.
  - debian/Rules (clean): Remove Lib/ocaml/swigp4.ml.
  - drop "--without-mzscheme", we don't have it in our build-depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 * See the file LICENSE for information on usage and redistribution.
10
10
 * ----------------------------------------------------------------------------- */
11
11
 
12
 
char cvsroot_hash_c[] = "$Id: hash.c 9629 2006-12-30 18:27:47Z beazley $";
 
12
char cvsroot_hash_c[] = "$Id: hash.c 10540 2008-06-21 15:23:02Z wsfulton $";
13
13
 
14
14
#include "dohint.h"
15
15
 
112
112
  int i;
113
113
 
114
114
  for (i = 0; i < h->hashsize; i++) {
115
 
    if ((n = h->hashtable[i])) {
116
 
      while (n) {
117
 
        next = n->next;
118
 
        DelNode(n);
119
 
        n = next;
120
 
      }
 
115
    n = h->hashtable[i];
 
116
    while (n) {
 
117
      next = n->next;
 
118
      DelNode(n);
 
119
      n = next;
121
120
    }
122
121
  }
123
122
  DohFree(h->hashtable);
138
137
  int i;
139
138
 
140
139
  for (i = 0; i < h->hashsize; i++) {
141
 
    if ((n = h->hashtable[i])) {
142
 
      while (n) {
143
 
        next = n->next;
144
 
        DelNode(n);
145
 
        n = next;
146
 
      }
 
140
    n = h->hashtable[i];
 
141
    while (n) {
 
142
      next = n->next;
 
143
      DelNode(n);
 
144
      n = next;
147
145
    }
148
146
    h->hashtable[i] = 0;
149
147
  }
454
452
 
455
453
  nho = DohObjMalloc(&DohHashType, nh);
456
454
  for (i = 0; i < h->hashsize; i++) {
457
 
    if ((n = h->hashtable[i])) {
458
 
      while (n) {
459
 
        Hash_setattr(nho, n->key, n->object);
460
 
        n = n->next;
461
 
      }
 
455
    n = h->hashtable[i];
 
456
    while (n) {
 
457
      Hash_setattr(nho, n->key, n->object);
 
458
      n = n->next;
462
459
    }
463
460
  }
464
461
  return nho;