diff --git a/src/attributes/object.h b/src/attributes/object.h index 44bec8b56..b4d3f7870 100644 --- a/src/attributes/object.h +++ b/src/attributes/object.h @@ -21,7 +21,7 @@ extern "C" { typedef enum { TNONE = 0, TINTEGER = 1, TREAL = 2, TSTRING = 3, - TUNIT = 10, TFACTION = 11, TREGION = 12, TBUILDING = 13, TSHIP = 14, + TUNIT = 10, TFACTION = 11, TREGION = 12, TBUILDING = 13, TSHIP = 14 } object_type; extern struct attrib_type at_object; diff --git a/src/bindings/bind_attrib.c b/src/bindings/bind_attrib.c index cdb2f0c6b..9e8d1a9c2 100644 --- a/src/bindings/bind_attrib.c +++ b/src/bindings/bind_attrib.c @@ -296,7 +296,7 @@ static int read_ext(attrib * a, void *owner, struct storage *store) a->data.v = 0; ur_add(data, a, resolve_bson); return AT_READ_OK; -}; +} attrib_type at_lua_ext = { "lua", init_ext, free_ext, age_ext, write_ext, read_ext diff --git a/src/bindings/bind_faction.c b/src/bindings/bind_faction.c index c0ca97b8c..a9a181f78 100644 --- a/src/bindings/bind_faction.c +++ b/src/bindings/bind_faction.c @@ -69,7 +69,7 @@ int tolua_faction_add_item(lua_State * L) if (itype != NULL) { item *i = i_change(&self->items, itype, number); result = i ? i->number : 0; - } // if (itype!=NULL) + } /* if (itype!=NULL) */ } lua_pushnumber(L, result); return 1; diff --git a/src/bindings/bind_message.c b/src/bindings/bind_message.c index cd7bcc8a7..ae27573d9 100644 --- a/src/bindings/bind_message.c +++ b/src/bindings/bind_message.c @@ -1,7 +1,7 @@ #include #include -// kernel includes +/* kernel includes */ #include #include #include @@ -9,10 +9,10 @@ #include #include -// util includes +/* util includes */ #include -// lua includes +/* lua includes */ #include #include diff --git a/src/bindings/bind_unit.c b/src/bindings/bind_unit.c index 8542d60c7..49c65d786 100644 --- a/src/bindings/bind_unit.c +++ b/src/bindings/bind_unit.c @@ -16,11 +16,11 @@ without prior permission by the authors of Eressea. #include "bind_attrib.h" #include "bindings.h" -// attributes includes +/* attributes includes */ #include #include -// kernel includes +/* kernel includes */ #include #include #include @@ -37,7 +37,7 @@ without prior permission by the authors of Eressea. #include #include -// util includes +/* util includes */ #include #include #include @@ -937,7 +937,7 @@ void tolua_unit_open(lua_State * L) tolua_function(L, TOLUA_CAST "clear_orders", &tolua_unit_clear_orders); tolua_variable(L, TOLUA_CAST "orders", &tolua_unit_get_orders, 0); - // key-attributes for named flags: + /* key-attributes for named flags: */ tolua_function(L, TOLUA_CAST "set_flag", &tolua_unit_set_flag); tolua_function(L, TOLUA_CAST "get_flag", &tolua_unit_get_flag); tolua_variable(L, TOLUA_CAST "flags", &tolua_unit_get_flags, @@ -945,21 +945,21 @@ void tolua_unit_open(lua_State * L) tolua_variable(L, TOLUA_CAST "age", &tolua_unit_get_age, tolua_unit_set_age); - // items: + /* items: */ tolua_function(L, TOLUA_CAST "get_item", &tolua_unit_get_item); tolua_function(L, TOLUA_CAST "add_item", &tolua_unit_add_item); tolua_variable(L, TOLUA_CAST "items", &tolua_unit_get_items, 0); tolua_function(L, TOLUA_CAST "get_pooled", &tolua_unit_get_pooled); tolua_function(L, TOLUA_CAST "use_pooled", &tolua_unit_use_pooled); - // skills: + /* skills: */ tolua_function(L, TOLUA_CAST "get_skill", &tolua_unit_getskill); tolua_function(L, TOLUA_CAST "eff_skill", &tolua_unit_effskill); tolua_function(L, TOLUA_CAST "set_skill", &tolua_unit_setskill); tolua_function(L, TOLUA_CAST "add_notice", &tolua_unit_addnotice); - // npc logic: + /* npc logic: */ tolua_function(L, TOLUA_CAST "add_handler", &tolua_unit_addhandler); tolua_variable(L, TOLUA_CAST "race_name", &tolua_unit_get_racename, diff --git a/src/eressea.c b/src/eressea.c index f1a9c1ab3..e637d2292 100644 --- a/src/eressea.c +++ b/src/eressea.c @@ -23,7 +23,7 @@ #include #include #include -#endif // BINDINGS_TOLUA +#endif /* BINDINGS_TOLUA */ #if MUSEUM_MODULE #include diff --git a/src/gamecode/laws.c b/src/gamecode/laws.c index b9472dcf3..19dd3dbd6 100644 --- a/src/gamecode/laws.c +++ b/src/gamecode/laws.c @@ -731,7 +731,7 @@ static void growing_trees_e3(region * r, const int current_season, const int last_weeks_season) { - const static int transform[4][3] = { + static const int transform[4][3] = { {-1, -1, 0}, {TREE_SEED, TREE_SAPLING, 2}, {TREE_SAPLING, TREE_TREE, 2}, diff --git a/src/gamecode/report.c b/src/gamecode/report.c index 1d64a60ba..5d635992d 100644 --- a/src/gamecode/report.c +++ b/src/gamecode/report.c @@ -2400,7 +2400,7 @@ report_plaintext(const char *filename, report_context * ctx, rnl(F); nr_paragraph(F, m, f); } - // + /* */ } else { if (!fval(r->terrain, SEA_REGION) && rpeasants(r) / TRADE_FRACTION > 0) { rnl(F); diff --git a/src/gamecode/xmlreport.c b/src/gamecode/xmlreport.c index afcb067eb..fc4666f37 100644 --- a/src/gamecode/xmlreport.c +++ b/src/gamecode/xmlreport.c @@ -754,7 +754,7 @@ static xmlNodePtr report_root(report_context * ctx) xmlAddChild(xmlReport, xml_region(ctx, sr)); } return xmlReport; -}; +} /* main function of the xmlreport. creates the header and traverses all regions */ static int diff --git a/src/kernel/alliance.c b/src/kernel/alliance.c index f9e93637a..aca0c35a8 100644 --- a/src/kernel/alliance.c +++ b/src/kernel/alliance.c @@ -96,8 +96,8 @@ typedef struct alliance_transaction { struct alliance_transaction *next; unit *u; order *ord; -// alliance * al; -// variant userdata; +/* alliance * al; */ +/* variant userdata; */ } alliance_transaction; static struct alliance_transaction *transactions[ALLIANCE_MAX]; @@ -321,9 +321,9 @@ void alliance_cmd(void) if (stree == NULL) { syntaxtree *slang = stree = stree_create(); while (slang) { - // struct tnode * root = calloc(sizeof(tnode), 1); + /* struct tnode * root = calloc(sizeof(tnode), 1); */ struct tnode *leaf = calloc(sizeof(tnode), 1); - // add_command(root, leaf, LOC(slang->lang, "alliance"), NULL); + /* add_command(root, leaf, LOC(slang->lang, "alliance"), NULL); */ add_command(leaf, NULL, LOC(slang->lang, "new"), &cmd_new); add_command(leaf, NULL, LOC(slang->lang, "invite"), &cmd_invite); add_command(leaf, NULL, LOC(slang->lang, "join"), &cmd_join); diff --git a/src/kernel/item.c b/src/kernel/item.c index 9f56280ea..72f21cac8 100644 --- a/src/kernel/item.c +++ b/src/kernel/item.c @@ -494,7 +494,9 @@ item *i_change(item ** pi, const item_type * itype, int delta) if (i->number < 0) { log_error(("serious accounting error. number of items is %d.\n", i->number)); + /* FIXME what's this supposed to mean?? assert(i >= 0); + */ i->number = 0; } if (i->number == 0) { diff --git a/src/kernel/magic.h b/src/kernel/magic.h index 74cd5eb33..311024d54 100644 --- a/src/kernel/magic.h +++ b/src/kernel/magic.h @@ -53,7 +53,7 @@ extern "C" { SPP_BUILDING, /* - : atoi() -> int */ SPP_SHIP, /* - : atoi() -> int */ SPP_STRING, /* "c" */ - SPP_INT, /* "i" : atoi() -> int */ + SPP_INT /* "i" : atoi() -> int */ } sppobj_t; typedef struct spllprm { diff --git a/src/kernel/reports.c b/src/kernel/reports.c index 79cb31fa6..219660ca7 100644 --- a/src/kernel/reports.c +++ b/src/kernel/reports.c @@ -1141,7 +1141,7 @@ void seen_done(seen_region * seehash[]) reuse = seehash[i]; seehash[i] = NULL; } - // free(seehash); + /* free(seehash); */ } void free_seen(void) diff --git a/src/kernel/skill.h b/src/kernel/skill.h index 6cf79debf..8d91aab37 100644 --- a/src/kernel/skill.h +++ b/src/kernel/skill.h @@ -22,7 +22,7 @@ extern "C" { #define SMF_RIDING (1<<2) /* Bonus für berittene - an der rasse */ typedef struct skill { - skill_t id:8; + unsigned int id:8; unsigned int level:8; unsigned int weeks:8; unsigned int old:8; diff --git a/src/kernel/textstore.c b/src/kernel/textstore.c index fe2fd251a..7c12d89be 100644 --- a/src/kernel/textstore.c +++ b/src/kernel/textstore.c @@ -135,7 +135,7 @@ static int txt_open(struct storage *store, const char *filename, int mode) FILE *F = fopen(filename, modes[mode]); store->userdata = F; if (F) { - const char utf8_bom[4] = { 0xef, 0xbb, 0xbf }; + char utf8_bom[4] = { (char)0xef, (char)0xbb, (char)0xbf }; if (mode == IO_READ) { char token[8]; /* recognize UTF8 BOM */ diff --git a/src/kernel/xmlreader.c b/src/kernel/xmlreader.c index c3cfd2de9..6cef9d00c 100644 --- a/src/kernel/xmlreader.c +++ b/src/kernel/xmlreader.c @@ -1869,9 +1869,9 @@ static int parse_races(xmlDocPtr doc) assert(propValue != NULL); frc = rc_find((const char *)propValue); if (frc == NULL) { -// log_error(("%s not registered, is familiar for %s\n", -// (const char*)propValue, rc->_name[0])); -// assert(frc!=NULL); +/* log_error(("%s not registered, is familiar for %s\n", */ +/* (const char*)propValue, rc->_name[0])); */ +/* assert(frc!=NULL); */ frc = rc_add(rc_new((const char *)propValue)); } if (xml_bvalue(node, "default", false)) { diff --git a/src/platform.h b/src/platform.h index cdf87ea37..b6d201040 100644 --- a/src/platform.h +++ b/src/platform.h @@ -16,6 +16,8 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **/ +#define _GNU_SOURCE + #ifndef CONFIG_H #define CONFIG_H diff --git a/src/util/strings.c b/src/util/strings.c index 94e0577f8..ade70fe35 100644 --- a/src/util/strings.c +++ b/src/util/strings.c @@ -51,7 +51,7 @@ escape_string_inplace(char * buffer, unsigned int len, unsigned int offset) } d[i] = o; if (i> 12); a = a + (a << 2); a = a ^ (a >> 4); - a = a * 2057; // a = (a + (a << 3)) + (a << 11); + a = a * 2057; /* a = (a + (a << 3)) + (a << 11); */ a = a ^ (a >> 16); return a; } diff --git a/src/util/unicode.c b/src/util/unicode.c index e15aa44f3..ca7d0fbad 100644 --- a/src/util/unicode.c +++ b/src/util/unicode.c @@ -81,12 +81,12 @@ unicode_latin1_to_utf8(utf8_t * out, size_t * outlen, const char *in, if (c > 0xBF) { if (op - out >= os - 1) break; - *op++ = 0xC3; + *op++ = (char) 0xC3; *op++ = c - 64; } else if (c > 0x7F) { if (op - out >= os - 1) break; - *op++ = 0xC2; + *op++ = (char) 0xC2; *op++ = c; } else { if (op - out >= os) diff --git a/src/util/xml.c b/src/util/xml.c index de9aa0cd1..cd1878206 100644 --- a/src/util/xml.c +++ b/src/util/xml.c @@ -28,7 +28,7 @@ const xmlChar *xml_i(double number) { static char buffer[128]; - snprintf(buffer, sizeof(buffer), "%.0lf", number); + snprintf(buffer, sizeof(buffer), "%.0f", number); return (const xmlChar *)buffer; }