Changeset 4d86e06 for variable.c


Ignore:
Timestamp:
Jul 23, 2009, 12:53:57 AM (15 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
ba6c8bd
Parents:
029a8b5
Message:
Get rid of a whole bunch of useless casts.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • variable.c

    rd43edd2 r4d86e06  
    521521      return(-2);
    522522    }
    523     owl_dict_insert_element(vd, cur->name, (void*)cur, NULL);
     523    owl_dict_insert_element(vd, cur->name, cur, NULL);
    524524  }
    525525  return 0;
     
    528528void owl_variable_dict_add_variable(owl_vardict * vardict,
    529529                                    owl_variable * var) {
    530   owl_dict_insert_element(vardict, var->name, (void*)var, (void(*)(void*))owl_variable_free);
     530  owl_dict_insert_element(vardict, var->name, var, (void(*)(void*))owl_variable_free);
    531531}
    532532
    533533owl_variable * owl_variable_newvar(char *name, char *summary, char * description) {
    534   owl_variable * var = (owl_variable*)owl_malloc(sizeof(owl_variable));
     534  owl_variable * var = owl_malloc(sizeof(owl_variable));
    535535  memset(var, 0, sizeof(owl_variable));
    536536  var->name = owl_strdup(name);
     
    739739/* returns a reference */
    740740char *owl_variable_get_string(owl_vardict *d, char *name) {
    741   return (char*)owl_variable_get(d,name, OWL_VARIABLE_STRING);
     741  return owl_variable_get(d,name, OWL_VARIABLE_STRING);
    742742}
    743743
    744744/* returns a reference */
    745745void *owl_variable_get_other(owl_vardict *d, char *name) {
    746   return (char*)owl_variable_get(d,name, OWL_VARIABLE_OTHER);
     746  return owl_variable_get(d,name, OWL_VARIABLE_OTHER);
    747747}
    748748
    749749int owl_variable_get_int(owl_vardict *d, char *name) {
    750750  int *pi;
    751   pi = (int*)owl_variable_get(d,name,OWL_VARIABLE_INT);
     751  pi = owl_variable_get(d,name,OWL_VARIABLE_INT);
    752752  if (!pi) return(-1);
    753753  return(*pi);
     
    756756int owl_variable_get_bool(owl_vardict *d, char *name) {
    757757  int *pi;
    758   pi = (int*)owl_variable_get(d,name,OWL_VARIABLE_BOOL);
     758  pi = owl_variable_get(d,name,OWL_VARIABLE_BOOL);
    759759  if (!pi) return(-1);
    760760  return(*pi);
Note: See TracChangeset for help on using the changeset viewer.