/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/baseobject.c

  • Committer: Gustav Hartvigsson
  • Date: 2015-04-08 18:25:07 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20150408182507-094jw13yhmi3bhfu
* Added "check" target for testing.
* Changed SRC to SSTS_SRC for future proofing.
* Removed a few "_" from before some struct names. It is not needed.
* Re-wrote how s_object_to_string () works on SError's. Should be faster now, but less safe...
  * To make this work I added SErrorTypeName string array. (Need to surpress the errer it creats).
* Re-orderd SErrorType enum.
* Use s_string_new_fmt () the default method for s_object_to_string ().
* Changed to strdup in some functions in utils.c.
* Added s_current_time () function to get an ISO time string.
* Added some more documentation to utils.h
* !DEBUG -> DEBUG in utils.h
* Added more tests to the test suite.
* Re-Wrote test_macros.h to display time, making it a lil' bit nicer to look at.

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
}
144
144
 
145
145
char * s_object_to_string (SObject * self) {
146
 
  char * ret = self->base_class->to_string (self);
147
 
  return ret;
 
146
  return self->base_class->to_string (self);
148
147
}
149
148
 
150
149
/* -----------------
158
157
void method_base_initialize (SObject * self) { }
159
158
 
160
159
void method_base_free (SObject * self) {
161
 
  
162
 
  
163
 
  
164
160
  free (self->base_class);
165
161
  free (self);
166
162
}
184
180
}
185
181
 
186
182
char * method_base_to_string (SObject * self) {
187
 
  char * ret_string = malloc (sizeof (char) * 32); // I am bad with maths..
188
 
  sprintf (ret_string, "References: %d ", self->base_class->get_refcount(self));
 
183
  char * ret_string = s_string_new_fmt ("References: %d", self->base_class->get_refcount(self));
189
184
  return ret_string;
190
185
}
191
186