/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to src/Map.c

  • Committer: Gustav Hartvigsson
  • Date: 2015-04-10 15:24:35 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20150410152435-uumooulvwmn02rxb
* Renamed DynamicArray to SDynamicArray.
* Renamed dynamic_array_*() functions to s_dynamic_array_*()
* Fixed indentation problem in Error.h and defs.h
* Removed dependency on stdbool.h
* Added sboolean
* Addad sconstpointer
* Reverted SMap back no not depending on SObject.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
  SMap * self = malloc (sizeof (SMap));
50
50
  SMapClass * klass = malloc (sizeof (SMapClass));
51
51
  
52
 
  s_object_initialize (S_OBJECT(self));
53
 
  
54
 
  s_object_set_class (S_OBJECT_CLASS(klass));
55
 
  
56
52
  self->priv = malloc (sizeof (SMapPrivate));
57
53
  self->priv->len = 0;
58
54
  
94
90
  SMapItem ** items = self->priv->items;
95
91
  CompFunc comp_func = self->klass->is_equal;
96
92
  for (size_t i = 0; i < self->priv->len; i++) {
97
 
    bool is_item = comp_func (key, items[i]);
 
93
    sboolean is_item = comp_func (key, items[i]);
98
94
    if (is_item) {
99
95
      return items[i];
100
96
    }