~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to snmplib/container_binary_array.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-12-08 14:59:50 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20071208145950-u1tykhpw56nyzqik
Tags: 5.4.1~dfsg-4ubuntu1
* Merge from debian unstable.
* Remaining Ubuntu changes:
  - Remove stop links from rc0 and rc6
  - Munge Maintainer field as per spec.
* Ubuntu changes dropped:
  - Symlink common files between the packages, CDBS ought to handle that
    for us automatically.
* The latest Debian changes has dropped history from the changelog. Slot in
  the Ubuntu changes as best I can. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * container_binary_array.c
3
 
 * $Id: container_binary_array.c,v 1.23 2005/12/11 19:13:15 nba Exp $
 
3
 * $Id: container_binary_array.c 15055 2006-08-23 15:53:22Z tanders $
4
4
 *
5
5
 * see comments in header file.
6
6
 *
398
398
            memcpy(new_data, t->data, t->max_size * t->data_size);
399
399
            SNMP_FREE(t->data);
400
400
        }
401
 
        t->data = new_data;
 
401
        t->data = (void**)new_data;
402
402
        t->max_size = new_max;
403
403
    }
404
404
 
405
405
    /*
406
406
     * Insert the new entry into the data array
407
407
     */
408
 
    t->data[t->count++] = entry;
 
408
    t->data[t->count++] = (void *)entry;
409
409
    t->dirty = 1;
410
410
    return 0;
411
411
}
484
484
    /*
485
485
     * find matching items
486
486
     */
487
 
    start = end = binary_search_for_start(key, c);
 
487
    start = end = binary_search_for_start((netsnmp_index *)key, c);
488
488
    if (start == -1)
489
489
        return 0;
490
490
 
495
495
    }
496
496
 
497
497
    *len = end - start + 1;
498
 
    subset = malloc((*len) * t->data_size);
 
498
    subset = (void **)malloc((*len) * t->data_size);
499
499
    if (subset)
500
500
        memcpy(subset, &t->data[start], t->data_size * (*len));
501
501