removing some naming conflicts that hapen when trying to re-enable amalgamation builds.

This commit is contained in:
Enno Rehling 2014-04-11 19:20:20 -07:00
parent e99b69d76e
commit 7358c48580
42 changed files with 154 additions and 164 deletions

View file

@ -132,14 +132,14 @@ static int tolua_selected_regions(lua_State * L)
static int tolua_state_open(lua_State * L)
{
unused(L);
unused_arg(L);
state_open();
return 0;
}
static int tolua_state_close(lua_State * L)
{
unused(L);
unused_arg(L);
state_close(current_state);
return 0;
}

View file

@ -346,7 +346,7 @@ static int cr_alliance(variant var, char *buffer, const void *userdata)
if (al != NULL) {
sprintf(buffer, "%d", al->id);
}
unused(userdata);
unused_arg(userdata);
return 0;
}

View file

@ -368,7 +368,7 @@ static void paint_info_region(window * wnd, const state * st)
int line = 0, maxline = getmaxy(win) - 2;
map_region *mr = cursor_region(&st->display, &st->cursor);
unused(st);
unused_arg(st);
werase(win);
wxborder(win);
if (mr && mr->r) {
@ -1276,7 +1276,7 @@ int
curses_readline(struct lua_State *L, char *buffer, size_t size,
const char *prompt)
{
unused(L);
unused_arg(L);
askstring(hstatus, prompt, buffer, size);
return buffer[0] != 0;
}

View file

@ -119,7 +119,7 @@ use_antimagiccrystal(unit * u, const struct item_type *itype, int amount,
float force;
spell *sp = find_spell("antimagiczone");
attrib **ap = &r->attribs;
unused(ord);
unused_arg(ord);
assert(sp);
/* Reduziert die Stärke jedes Spruchs um effect */

View file

@ -39,8 +39,8 @@ summon_igjarjuk(struct unit *u, const struct item_type *itype, int amount,
struct order *ord)
{
struct plane *p = rplane(u->region);
unused(amount);
unused(itype);
unused_arg(amount);
unused_arg(itype);
if (p != NULL) {
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "use_realworld_only", ""));
return EUNUSABLE;

View file

@ -42,8 +42,8 @@ use_speedsail(struct unit *u, const struct item_type *itype, int amount,
struct order *ord)
{
struct plane *p = rplane(u->region);
unused(amount);
unused(itype);
unused_arg(amount);
unused_arg(itype);
if (p != NULL) {
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "use_realworld_only", ""));
} else {

View file

@ -267,7 +267,7 @@ extern "C" {
int ispresent(const struct faction *f, const struct region *r);
int check_option(struct faction *f, int option);
extern void parse(keyword_t kword, int (*dofun) (struct unit *,
extern void parse_kwd(keyword_t kword, int (*dofun) (struct unit *,
struct order *), bool thisorder);
/* Anzahl Personen in einer Einheit festlegen. NUR (!) mit dieser Routine,

View file

@ -230,31 +230,29 @@ void b_write(const connection * b, storage * store)
bool b_transparent(const connection * b, const struct faction *f)
{
unused(b);
unused(f);
unused_arg(b);
unused_arg(f);
return true;
}
bool b_opaque(const connection * b, const struct faction * f)
{
unused(b);
unused(f);
unused_arg(b);
unused_arg(f);
return false;
}
bool b_blockall(const connection * b, const unit * u, const region * r)
{
unused(u);
unused(r);
unused(b);
unused_arg(u);
unused_arg(r);
unused_arg(b);
return true;
}
bool b_blocknone(const connection * b, const unit * u, const region * r)
{
unused(u);
unused(r);
unused(b);
unused_arg((u, r, b));
return false;
}
@ -266,39 +264,36 @@ bool b_rvisible(const connection * b, const region * r)
bool b_fvisible(const connection * b, const struct faction * f,
const region * r)
{
unused(r);
unused(f);
unused(b);
unused_arg(r, f, b);
return true;
}
bool b_uvisible(const connection * b, const unit * u)
{
unused(u);
unused(b);
unused_arg(u, b);
return true;
}
bool b_rinvisible(const connection * b, const region * r)
{
unused(r);
unused(b);
unused_arg(r);
unused_arg(b);
return false;
}
bool b_finvisible(const connection * b, const struct faction * f,
const region * r)
{
unused(r);
unused(f);
unused(b);
unused_arg(r);
unused_arg(f);
unused_arg(b);
return false;
}
bool b_uinvisible(const connection * b, const unit * u)
{
unused(u);
unused(b);
unused_arg(u);
unused_arg(b);
return false;
}
@ -352,9 +347,9 @@ static const char *b_namewall(const connection * b, const region * r,
{
const char *bname = "wall";
unused(f);
unused(r);
unused(b);
unused_arg(f);
unused_arg(r);
unused_arg(b);
if (gflags & GF_ARTICLE)
bname = "a_wall";
if (gflags & GF_PURE)
@ -393,9 +388,9 @@ border_type bt_noway = {
static const char *b_namefogwall(const connection * b, const region * r,
const struct faction *f, int gflags)
{
unused(f);
unused(b);
unused(r);
unused_arg(f);
unused_arg(b);
unused_arg(r);
if (gflags & GF_PURE)
return "fogwall";
if (gflags & GF_ARTICLE)
@ -406,8 +401,8 @@ static const char *b_namefogwall(const connection * b, const region * r,
static bool
b_blockfogwall(const connection * b, const unit * u, const region * r)
{
unused(b);
unused(r);
unused_arg(b);
unused_arg(r);
if (!u)
return true;
return (bool) (effskill(u, SK_PERCEPTION) > 4); /* Das ist die alte Nebelwand */
@ -432,8 +427,8 @@ static const char *b_nameillusionwall(const connection * b, const region * r,
const struct faction *f, int gflags)
{
int fno = b->data.i;
unused(b);
unused(r);
unused_arg(b);
unused_arg(r);
if (gflags & GF_PURE)
return (f && fno == f->no) ? "illusionwall" : "wall";
if (gflags & GF_ARTICLE) {
@ -475,8 +470,8 @@ static const char *b_namequestportal(const connection * b, const region * r,
{
const char *bname;
int lock = b->data.i;
unused(b);
unused(r);
unused_arg(b);
unused_arg(r);
if (gflags & GF_ARTICLE) {
if (lock > 0) {
@ -521,7 +516,7 @@ static const char *b_nameroad(const connection * b, const region * r,
int local = (r == b->from) ? b->data.sa[0] : b->data.sa[1];
static char buffer[64];
unused(f);
unused_arg(f);
if (gflags & GF_PURE)
return "road";
if (gflags & GF_ARTICLE) {

View file

@ -56,8 +56,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <math.h>
#include <ctype.h>
#include <tests.h>
#define MAXENTITYHASH 7919
curse *cursehash[MAXENTITYHASH];
@ -769,9 +767,9 @@ message *cinfo_simple(const void *obj, objtype_t typ, const struct curse * c,
{
struct message *msg;
unused(typ);
unused(self);
unused(obj);
unused_arg(typ);
unused_arg(self);
unused_arg(obj);
msg = msg_message(mkname("curseinfo", c->type->cname), "id", c->no);
if (msg == NULL) {

View file

@ -635,9 +635,9 @@ use_birthdayamulet(unit * u, const struct item_type *itype, int amount,
direction_t d;
message *msg = msg_message("meow", "");
unused(ord);
unused(amount);
unused(itype);
unused_arg(ord);
unused_arg(amount);
unused_arg(itype);
add_message(&u->region->msgs, msg);
for (d = 0; d < MAXDIRECTIONS; d++) {
@ -676,7 +676,7 @@ use_tacticcrystal(unit * u, const struct item_type *itype, int amount,
c = create_curse(u, &u->attribs, ct_find("skillmod"), power,
duration, effect, u->number);
c->data.i = SK_TACTICS;
unused(ord);
unused_arg(ord);
}
use_pooled(u, itype->rtype, GET_DEFAULT, amount);
ADDMSG(&u->faction->msgs, msg_message("use_tacticcrystal",
@ -714,7 +714,7 @@ mod_elves_only(const unit * u, const region * r, skill_t sk, int value)
{
if (u_race(u) == new_race[RC_ELF])
return value;
unused(r);
unused_arg(r);
return -118;
}
@ -723,7 +723,7 @@ mod_dwarves_only(const unit * u, const region * r, skill_t sk, int value)
{
if (u_race(u) == new_race[RC_DWARF])
return value;
unused(r);
unused_arg(r);
return -118;
}

View file

@ -201,7 +201,7 @@ caddmessage(region * r, faction * f, const char *s, msg_t mtype, int level)
log_warning("message for locale \"%s\": %s\n", locale_name(f->locale), s);
}
#endif
unused(level);
unused_arg(level);
switch (mtype) {
case MSG_INCOME:
assert(f);
@ -255,7 +255,7 @@ message * cmistake(const unit * u, struct order *ord, int mno, int mtype)
{
message * result;
static char msgname[20];
unused(mtype);
unused_arg(mtype);
if (is_monsters(u->faction))
return 0;

View file

@ -2127,7 +2127,7 @@ static void eval_order(struct opstack **stack, const void *userdata)
size_t len;
variant var;
unused(userdata);
unused_arg(userdata);
write_order(ord, buf, sizeof(buf));
len = strlen(buf);
var.v = strcpy(balloc(len + 1), buf);
@ -2282,7 +2282,7 @@ static void eval_int36(struct opstack **stack, const void *userdata)
var.v = strcpy(balloc(len + 1), c);
opush(stack, var);
unused(userdata);
unused_arg(userdata);
}
/*** END MESSAGE RENDERING ***/

View file

@ -119,7 +119,7 @@ static void terraform_default(struct rawmaterial *res, const region * r)
res->amount = (int)(res->amount * modifier); /* random adjustment, +/- 91% */
if (res->amount < 1)
res->amount = 1;
unused(r);
unused_arg(r);
}
#ifdef RANDOM_CHANGE

View file

@ -102,13 +102,13 @@ void st_register(const ship_type * type)
ql_push(&shiptypes, (void *)type);
}
#define SMAXHASH 7919
ship *shiphash[SMAXHASH];
#define MAXSHIPHASH 7919
ship *shiphash[MAXSHIPHASH];
void shash(ship * s)
{
ship *old = shiphash[s->no % SMAXHASH];
ship *old = shiphash[s->no % MAXSHIPHASH];
shiphash[s->no % SMAXHASH] = s;
shiphash[s->no % MAXSHIPHASH] = s;
s->nexthash = old;
}
@ -116,7 +116,7 @@ void sunhash(ship * s)
{
ship **show;
for (show = &shiphash[s->no % SMAXHASH]; *show; show = &(*show)->nexthash) {
for (show = &shiphash[s->no % MAXSHIPHASH]; *show; show = &(*show)->nexthash) {
if ((*show)->no == s->no)
break;
}
@ -131,7 +131,7 @@ static ship *sfindhash(int i)
{
ship *old;
for (old = shiphash[i % SMAXHASH]; old; old = old->nexthash)
for (old = shiphash[i % MAXSHIPHASH]; old; old = old->nexthash)
if (old->no == i)
return old;
return 0;

View file

@ -749,7 +749,7 @@ void set_level(unit * u, skill_t sk, int value)
static int leftship_age(struct attrib *a)
{
/* must be aged, so it doesn't affect report generation (cansee) */
unused(a);
unused_arg(a);
return AT_AGE_REMOVE; /* remove me */
}

View file

@ -28,8 +28,6 @@ without prior permission by the authors of Eressea.
#include <kernel/region.h>
#include <kernel/unit.h>
#include <tests.h>
static unsigned int get_markets(region * r, unit ** results, size_t size)
{
unsigned int n = 0;

View file

@ -107,9 +107,9 @@ leave_arena(struct unit *u, const struct item_type *itype, int amount,
if (u->building != arena_tower(u->faction->magiegebiet) && leave_fail(u)) {
return -1;
}
unused(amount);
unused(ord);
unused(itype);
unused_arg(amount);
unused_arg(ord);
unused_arg(itype);
assert(!"not implemented");
return 0;
}
@ -128,9 +128,9 @@ enter_arena(unit * u, const item_type * itype, int amount, order * ord)
region *r = u->region;
unit *u2;
int fee = u->faction->score / 5;
unused(ord);
unused(amount);
unused(itype);
unused_arg(ord);
unused_arg(amount);
unused_arg(itype);
if (fee > 2000)
fee = 2000;
if (getplane(r) == arena)
@ -186,7 +186,7 @@ use_wand_of_tears(unit * user, const struct item_type *itype, int amount,
order * ord)
{
int n;
unused(ord);
unused_arg(ord);
for (n = 0; n != amount; ++n) {
unit *u;
for (u = user->region->units; u; u = u->next) {
@ -432,7 +432,7 @@ static int caldera_handle(trigger * t, void *data)
} else {
log_error("could not perform caldera::handle()\n");
}
unused(data);
unused_arg(data);
return 0;
}

View file

@ -306,7 +306,7 @@ use_museumexitticket(unit * u, const struct item_type *itype, int amount,
unit *warden = findunit(atoi36("mwar"));
int unit_cookie;
unused(amount);
unused_arg(amount);
/* Prüfen ob in Eingangshalle */
if (u->region->x != 9525 || u->region->y != 9525) {
@ -362,9 +362,9 @@ use_museumticket(unit * u, const struct item_type *itype, int amount,
region *r = u->region;
plane *pl = rplane(r);
unused(amount);
unused_arg(amount);
/* Prüfen ob in normaler Plane und nur eine Person */
/* Prüfen ob in normaler Plane und nur eine Person */
if (pl != get_homeplane()) {
cmistake(u, ord, 265, MSG_MAGIC);
return 0;

View file

@ -78,7 +78,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# define _XOPEN_SOURCE
#endif
#define unused (void)
#define unused_arg (void)
#ifndef INLINE_FUNCTION
# define INLINE_FUNCTION

View file

@ -234,9 +234,9 @@ static const char *b_namefirewall(const connection * b, const region * r,
const faction * f, int gflags)
{
const char *bname;
unused(f);
unused(r);
unused(b);
unused_arg(f);
unused_arg(r);
unused_arg(b);
if (gflags & GF_ARTICLE)
bname = "a_firewall";
else

View file

@ -36,7 +36,7 @@
static message *cinfo_building(const void *obj, objtype_t typ, const curse * c,
int self)
{
unused(typ);
unused_arg(typ);
assert(typ == TYP_BUILDING);
if (self != 0) { /* owner or inside */

View file

@ -46,8 +46,8 @@ static message *cinfo_cursed_by_the_gods(const void *obj, objtype_t typ,
{
region *r = (region *) obj;
unused(typ);
unused(self);
unused_arg(typ);
unused_arg(self);
assert(typ == TYP_REGION);
if (fval(r->terrain, SEA_REGION)) {
@ -69,9 +69,9 @@ static struct curse_type ct_godcursezone = {
static message *cinfo_dreamcurse(const void *obj, objtype_t typ, const curse * c,
int self)
{
unused(self);
unused(typ);
unused(obj);
unused_arg(self);
unused_arg(typ);
unused_arg(obj);
assert(typ == TYP_REGION);
if (curse_geteffect(c) > 0) {
@ -93,9 +93,9 @@ static struct curse_type ct_gbdream = {
static message *cinfo_magicstreet(const void *obj, objtype_t typ, const curse * c,
int self)
{
unused(typ);
unused(self);
unused(obj);
unused_arg(typ);
unused_arg(self);
unused_arg(obj);
assert(typ == TYP_REGION);
/* Warnung vor Auflösung */
@ -116,9 +116,9 @@ static struct curse_type ct_magicstreet = {
static message *cinfo_antimagiczone(const void *obj, objtype_t typ, const curse * c,
int self)
{
unused(typ);
unused(self);
unused(obj);
unused_arg(typ);
unused_arg(self);
unused_arg(obj);
assert(typ == TYP_REGION);
/* Magier spüren eine Antimagiezone */
@ -138,7 +138,7 @@ cansee_antimagiczone(const struct faction *viewer, const void *obj, objtype_t ty
unit *u = NULL;
unit *mage = c->magician;
unused(typ);
unused_arg(typ);
assert(typ == TYP_REGION);
r = (region *) obj;
@ -166,8 +166,8 @@ static struct curse_type ct_antimagiczone = {
static message *cinfo_farvision(const void *obj, objtype_t typ, const curse * c,
int self)
{
unused(typ);
unused(obj);
unused_arg(typ);
unused_arg(obj);
assert(typ == TYP_REGION);

View file

@ -40,8 +40,8 @@ message *cinfo_ship(const void *obj, objtype_t typ, const curse * c, int self)
{
message *msg;
unused(typ);
unused(obj);
unused_arg(typ);
unused_arg(obj);
assert(typ == TYP_SHIP);
if (self != 0) { /* owner or inside */
@ -63,7 +63,7 @@ static message *cinfo_shipnodrift(const void *obj, objtype_t typ, const curse *
{
ship *sh = (ship *) obj;
unused(typ);
unused_arg(typ);
assert(typ == TYP_SHIP);
if (self != 0) {

View file

@ -5569,7 +5569,7 @@ int sp_showastral(castorder * co)
free_regionlist(rl);
return cast_level;
unused(co);
unused_arg(co);
return 0;
}
#endif

View file

@ -48,7 +48,7 @@ static message *cinfo_auraboost(const void *obj, objtype_t typ, const curse * c,
int self)
{
struct unit *u = (struct unit *)obj;
unused(typ);
unused_arg(typ);
assert(typ == TYP_UNIT);
if (self != 0) {
@ -81,7 +81,7 @@ static message *cinfo_slave(const void *obj, objtype_t typ, const curse * c,
int self)
{
unit *u;
unused(typ);
unused_arg(typ);
assert(typ == TYP_UNIT);
u = (unit *) obj;
@ -105,7 +105,7 @@ static struct curse_type ct_slavery = { "slavery",
static message *cinfo_calm(const void *obj, objtype_t typ, const curse * c,
int self)
{
unused(typ);
unused_arg(typ);
assert(typ == TYP_UNIT);
if (c->magician && c->magician->faction) {
@ -134,7 +134,7 @@ static struct curse_type ct_calmmonster = {
static message *cinfo_speed(const void *obj, objtype_t typ, const curse * c,
int self)
{
unused(typ);
unused_arg(typ);
assert(typ == TYP_UNIT);
if (self != 0) {
@ -157,7 +157,7 @@ static struct curse_type ct_speed = {
*/
message *cinfo_unit(const void *obj, objtype_t typ, const curse * c, int self)
{
unused(typ);
unused_arg(typ);
assert(typ == TYP_UNIT);
if (self != 0) {
@ -181,7 +181,7 @@ static struct curse_type ct_orcish = {
static message *cinfo_kaelteschutz(const void *obj, objtype_t typ, const curse * c,
int self)
{
unused(typ);
unused_arg(typ);
assert(typ == TYP_UNIT);
if (self != 0) {
@ -233,7 +233,7 @@ static message *cinfo_sparkle(const void *obj, objtype_t typ, const curse * c,
};
int m, begin = 0, end = 0;
unit *u;
unused(typ);
unused_arg(typ);
assert(typ == TYP_UNIT);
u = (unit *) obj;
@ -333,7 +333,7 @@ write_skill(struct storage *store, const curse * c, const void *target)
static message *cinfo_skillmod(const void *obj, objtype_t typ, const curse * c,
int self)
{
unused(typ);
unused_arg(typ);
if (self != 0) {
unit *u = (unit *) obj;

View file

@ -3,8 +3,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#include <CuTest.h>
void test_cleanup(void);
struct terrain_type * test_create_terrain(const char * name, unsigned int flags);

View file

@ -70,7 +70,7 @@ static int changefaction_handle(trigger * t, void *data)
} else {
log_error("could not perform changefaction::handle()\n");
}
unused(data);
unused_arg(data);
return 0;
}

View file

@ -73,7 +73,7 @@ static int changerace_handle(trigger * t, void *data)
} else {
log_error("could not perform changerace::handle()\n");
}
unused(data);
unused_arg(data);
return 0;
}

View file

@ -56,7 +56,7 @@ static int clonedied_handle(trigger * t, void *data)
a_remove(&u->attribs, a);
} else
log_error("could not perform clonedied::handle()\n");
unused(data);
unused_arg(data);
return 0;
}

View file

@ -76,7 +76,7 @@ static int createcurse_handle(trigger * t, void *data)
} else {
log_error("could not perform createcurse::handle()\n");
}
unused(data);
unused_arg(data);
return 0;
}

View file

@ -74,7 +74,7 @@ static int createunit_handle(trigger * t, void *data)
} else {
log_error("could not perform createunit::handle()\n");
}
unused(data);
unused_arg(data);
return 0;
}

View file

@ -57,7 +57,7 @@ static int gate_handle(trigger * t, void *data)
log_error("could not perform gate::handle()\n");
return -1;
}
unused(data);
unused_arg(data);
return 0;
}

View file

@ -69,7 +69,7 @@ static int giveitem_handle(trigger * t, void *data)
} else {
log_error("could not perform giveitem::handle()\n");
}
unused(data);
unused_arg(data);
return 0;
}

View file

@ -48,7 +48,7 @@ static int killunit_handle(trigger * t, void *data)
/* we can't remove_unit() here, because that's what's calling us. */
set_number(u, 0);
}
unused(data);
unused_arg(data);
return 0;
}

View file

@ -68,7 +68,7 @@ static int removecurse_handle(trigger * t, void *data)
} else
log_error("could not perform removecurse::handle()\n");
}
unused(data);
unused_arg(data);
return 0;
}

View file

@ -97,7 +97,7 @@ static int shock_handle(trigger * t, void *data)
if (u && u->number) {
do_shock(u, "trigger");
}
unused(data);
unused_arg(data);
return 0;
}

View file

@ -61,7 +61,7 @@ static int timeout_handle(trigger * t, void *data)
handle_triggers(&td->triggers, NULL);
return -1;
}
unused(data);
unused_arg(data);
return 0;
}

View file

@ -38,7 +38,7 @@ static int unguard_handle(trigger * t, void *data)
log_error("could not perform unguard::handle()\n");
return -1;
}
unused(data);
unused_arg(data);
return 0;
}

View file

@ -71,7 +71,7 @@ static int unitmessage_handle(trigger * t, void *data)
td->level);
}
}
unused(data);
unused_arg(data);
return 0;
}

View file

@ -135,21 +135,21 @@ int cr_render(const message * msg, char *buffer, const void *userdata)
int cr_string(variant var, char *buffer, const void *userdata)
{
sprintf(buffer, "\"%s\"", (const char *)var.v);
unused(userdata);
unused_arg(userdata);
return 0;
}
int cr_int(variant var, char *buffer, const void *userdata)
{
sprintf(buffer, "%d", var.i);
unused(userdata);
unused_arg(userdata);
return 0;
}
int cr_ignore(variant var, char *buffer, const void *userdata)
{
unused(var);
unused(buffer);
unused(userdata);
unused_arg(var);
unused_arg(buffer);
unused_arg(userdata);
return -1;
}

View file

@ -18,7 +18,7 @@ typedef struct parser_state {
struct parser_state *next;
} parser_state;
static parser_state *state;
static parser_state *states;
static int eatwhitespace_c(const char **str_p)
{
@ -51,12 +51,12 @@ static int eatwhitespace_c(const char **str_p)
void init_tokens_str(const char *initstr, char *cmd)
{
if (state == NULL) {
state = malloc(sizeof(parser_state));
} else if (state->current_cmd)
free(state->current_cmd);
state->current_cmd = cmd;
state->current_token = initstr;
if (states == NULL) {
states = malloc(sizeof(parser_state));
} else if (states->current_cmd)
free(states->current_cmd);
states->current_cmd = cmd;
states->current_token = initstr;
}
void parser_pushstate(void)
@ -64,44 +64,44 @@ void parser_pushstate(void)
parser_state *new_state = malloc(sizeof(parser_state));
new_state->current_cmd = NULL;
new_state->current_token = NULL;
new_state->next = state;
state = new_state;
new_state->next = states;
states = new_state;
}
void parser_popstate(void)
{
parser_state *new_state = state->next;
if (state->current_cmd != NULL)
free(state->current_cmd);
free(state);
state = new_state;
parser_state *new_state = states->next;
if (states->current_cmd != NULL)
free(states->current_cmd);
free(states);
states = new_state;
}
bool parser_end(void)
{
eatwhitespace_c(&state->current_token);
return *state->current_token == 0;
eatwhitespace_c(&states->current_token);
return *states->current_token == 0;
}
void skip_token(void)
{
char quotechar = 0;
eatwhitespace_c(&state->current_token);
eatwhitespace_c(&states->current_token);
while (*state->current_token) {
while (*states->current_token) {
ucs4_t ucs;
size_t len;
unsigned char utf8_character = (unsigned char)state->current_token[0];
unsigned char utf8_character = (unsigned char)states->current_token[0];
if (~utf8_character & 0x80) {
ucs = utf8_character;
++state->current_token;
++states->current_token;
} else {
int ret = unicode_utf8_to_ucs4(&ucs, state->current_token, &len);
int ret = unicode_utf8_to_ucs4(&ucs, states->current_token, &len);
if (ret == 0) {
state->current_token += len;
states->current_token += len;
} else {
log_warning("illegal character sequence in UTF8 string: %s\n", state->current_token);
log_warning("illegal character sequence in UTF8 string: %s\n", states->current_token);
}
}
if (iswxspace((wint_t) ucs) && quotechar == 0) {
@ -115,7 +115,7 @@ void skip_token(void)
quotechar = utf8_character;
break;
case ESCAPE_CHAR:
++state->current_token;
++states->current_token;
break;
}
}
@ -189,5 +189,5 @@ const char *parse_token(const char **str)
const char *getstrtoken(void)
{
return parse_token((const char **)&state->current_token);
return parse_token((const char **)&states->current_token);
}

View file

@ -405,7 +405,7 @@ static void eval_lt(opstack ** stack, const void *userdata)
int b = opop_i(stack);
int rval = (b < a) ? 1 : 0;
opush_i(stack, rval);
unused(userdata);
unused_arg(userdata);
}
static void eval_eq(opstack ** stack, const void *userdata)
@ -414,7 +414,7 @@ static void eval_eq(opstack ** stack, const void *userdata)
int b = opop_i(stack);
int rval = (a == b) ? 1 : 0;
opush_i(stack, rval);
unused(userdata);
unused_arg(userdata);
}
static void eval_add(opstack ** stack, const void *userdata)
@ -422,14 +422,14 @@ static void eval_add(opstack ** stack, const void *userdata)
int a = opop_i(stack);
int b = opop_i(stack);
opush_i(stack, a + b);
unused(userdata);
unused_arg(userdata);
}
static void eval_isnull(opstack ** stack, const void *userdata)
{ /* (int, int) -> int */
void *a = opop_v(stack);
opush_i(stack, (a == NULL) ? 1 : 0);
unused(userdata);
unused_arg(userdata);
}
static void eval_if(opstack ** stack, const void *userdata)
@ -438,14 +438,14 @@ static void eval_if(opstack ** stack, const void *userdata)
void *b = opop_v(stack);
int cond = opop_i(stack);
opush_v(stack, cond ? b : a);
unused(userdata);
unused_arg(userdata);
}
static void eval_strlen(opstack ** stack, const void *userdata)
{ /* string -> int */
const char *c = (const char *)opop_v(stack);
opush_i(stack, c ? (int)strlen(c) : 0);
unused(userdata);
unused_arg(userdata);
}
#include "base36.h"