cleanup patches
123 <[email protected]>
| Newsgroups | gmane.comp.web.dillo.devel |
|---|---|
| Message-ID | <[email protected]> |
One patch for README, one for dFree (no need to check for NULL) and one for sizeof usage. _______________________________________________ Dillo-dev mailing list [email protected] http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
README.diff
(text/plain, 274 B)
diff -r 2e0beeb6f499 README
--- a/README Sat May 26 14:49:35 2012 +0400
+++ b/README Sat May 26 14:58:57 2012 +0400
@@ -30,9 +30,9 @@
* no https (there's a barebones prototype).
--------
+--------
FLTK-1.3
--------
+--------
You can get FLTK-1.3 here:
dFree.diff
(text/plain, 233 B)
diff -r 87bcbdb88cb0 dlib/dlib.c
--- a/dlib/dlib.c Sat Apr 07 19:02:18 2012 +0200
+++ b/dlib/dlib.c Sat May 26 14:59:13 2012 +0400
@@ -65,8 +65,7 @@
void dFree (void *mem)
{
- if (mem)
- free(mem);
+ free(mem);
}
/*
sizeof.diff
(text/plain, 3.3 KB)
diff -r 72f29338e9f1 src/colors.c
--- a/src/colors.c Sat May 26 14:49:44 2012 +0400
+++ b/src/colors.c Sat May 26 14:58:32 2012 +0400
@@ -201,7 +201,7 @@
#endif
};
-#define NCOLORS (sizeof(color_keyword) / sizeof(struct key))
+#define NCOLORS (sizeof(color_keyword) / sizeof(color_keyword[0]))
/*
* Parse a color in hex (RRGGBB) or (RGB)
diff -r 72f29338e9f1 src/cssparser.cc
--- a/src/cssparser.cc Sat May 26 14:49:44 2012 +0400
+++ b/src/cssparser.cc Sat May 26 14:58:32 2012 +0400
@@ -412,7 +412,7 @@
};
#define CSS_SHORTHAND_NUM \
- (sizeof(Css_shorthand_info) / sizeof(CssShorthandInfo))
+ (sizeof(Css_shorthand_info) / sizeof(Css_shorthand_info[0]))
/* ----------------------------------------------------------------------
* Parsing
diff -r 72f29338e9f1 src/keys.cc
--- a/src/keys.cc Sat May 26 14:49:44 2012 +0400
+++ b/src/keys.cc Sat May 26 14:58:32 2012 +0400
@@ -149,7 +149,7 @@
// Fill our key bindings list
bindings = dList_new(32);
- for (uint_t i = 0; i < sizeof(default_keys) / sizeof(KeyBinding_t); i++) {
+ for (uint_t i = 0; i < sizeof(default_keys) / sizeof(default_keys[0]); i++) {
if (default_keys[i].key) {
node = dNew(KeyBinding_t, 1);
node->name = dStrdup(default_keys[i].name);
@@ -244,7 +244,7 @@
int Keys::getKeyCode(char *keyName)
{
uint_t i;
- for (i = 0; i < sizeof(keyNames) / sizeof(Mapping_t); i++) {
+ for (i = 0; i < sizeof(keyNames) / sizeof(keyNames[0]); i++) {
if (!dStrAsciiCasecmp(keyNames[i].name, keyName)) {
return keyNames[i].value;
}
@@ -275,7 +275,7 @@
int Keys::getModifier(char *modifierName)
{
uint_t i;
- for (i = 0; i < sizeof(modifierNames) / sizeof(Mapping_t); i++) {
+ for (i = 0; i < sizeof(modifierNames) / sizeof(modifierNames[0]); i++) {
if (!dStrAsciiCasecmp(modifierNames[i].name, modifierName)) {
return modifierNames[i].value;
}
diff -r 72f29338e9f1 src/list.h
--- a/src/list.h Sat May 26 14:49:44 2012 +0400
+++ b/src/list.h Sat May 26 14:58:32 2012 +0400
@@ -16,12 +16,12 @@
*/
#define a_List_resize(list,num_items,alloc_step) \
if (!list) { \
- list = dMalloc(alloc_step * sizeof((*list))); \
+ list = dMalloc(alloc_step * sizeof(*list)); \
} \
if (num_items >= alloc_step){ \
while ( num_items >= alloc_step ) \
alloc_step <<= 1; \
- list = dRealloc(list, alloc_step * sizeof((*list))); \
+ list = dRealloc(list, alloc_step * sizeof(*list)); \
}
diff -r 72f29338e9f1 src/prefsparser.cc
--- a/src/prefsparser.cc Sat May 26 14:49:44 2012 +0400
+++ b/src/prefsparser.cc Sat May 26 14:58:32 2012 +0400
@@ -113,7 +113,7 @@
};
node = NULL;
- for (i = 0; i < sizeof(symbols) / sizeof(SymNode_t); i++) {
+ for (i = 0; i < sizeof(symbols) / sizeof(symbols[0]); i++) {
if (!strcmp(symbols[i].name, name)) {
node = & (symbols[i]);
break;
diff -r 72f29338e9f1 src/uicmd.cc
--- a/src/uicmd.cc Sat May 26 14:49:44 2012 +0400
+++ b/src/uicmd.cc Sat May 26 14:58:32 2012 +0400
@@ -1177,7 +1177,7 @@
};
KeysCommand_t keycmd = (KeysCommand_t)icmd;
- for (uint_t i = 0; i < (sizeof(map)/sizeof(mapping_t)); i++) {
+ for (uint_t i = 0; i < sizeof(map) / sizeof(map[0]); i++) {
if (keycmd == map[i].keys_cmd) {
layout->scroll(map[i].dw_cmd);
break;