diff options
Diffstat (limited to 'src/onecanvas.c')
-rw-r--r-- | src/onecanvas.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/onecanvas.c b/src/onecanvas.c index e53ece7..ba80175 100644 --- a/src/onecanvas.c +++ b/src/onecanvas.c @@ -28,11 +28,9 @@ #include <string.h> #include <math.h> #include <stdlib.h> +#include <stdbool.h> #include <time.h> -#define FALSE 0 -#define TRUE 1 - typedef struct { double x; double y; @@ -115,7 +113,7 @@ static inline char *xml_getTagName(char *c) static inline char *xml_getTagAttributePtr(char *c, char *attrname) { char *end, *name; - int found; + bool found = false; if(++c == NULL) return NULL; @@ -138,7 +136,7 @@ static inline char *xml_getTagAttributePtr(char *c, char *attrname) continue; if(strncasecmp(attrname, name, name_len) == 0) { - found = TRUE; + found = true; break; } } @@ -212,15 +210,15 @@ static inline char *xml_idMatchStart(char *stream_pos, char *layer_name) * Match the entirety of an XML tag by "id" (preferred) or Inkscape's * label (undesireable but acceptable). */ -static inline int xml_idMatch(char *stream_pos, char *layer_name) +static inline bool xml_idMatch(char *stream_pos, char *layer_name) { char *id_acceptable = xml_getTagAttribute(stream_pos, "inkscape:label"); char *id_preferred = xml_getTagAttribute(stream_pos, "id"); - int ret = FALSE; + bool ret = false; if((id_preferred && strcasecmp(id_preferred, layer_name) == 0) || (id_acceptable && strcasecmp(id_acceptable, layer_name) == 0)) - ret = TRUE; + ret = true; free(id_acceptable); free(id_preferred); return ret; @@ -443,4 +441,4 @@ char *onecanvas_geticon_bysize(char *icon_data, int requested_size) free(info.iconlist[i]); free(info.iconlist); return ret; -}
\ No newline at end of file +} |