Navigation Menu

Skip to content

Commit

Permalink
Revert "Fix warnings caused by casts between ints and pointers on 64bit"
Browse files Browse the repository at this point in the history
This reverts commit 4293a25.
The fix had introduced regressions on 32bit :<
  • Loading branch information
hmkemppainen committed May 15, 2009
1 parent 4293a25 commit ba6aeb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions uzbl.c
Expand Up @@ -107,7 +107,7 @@ const struct {
{ "SUPER", GDK_SUPER_MASK }, // super (since 2.10)
{ "HYPER", GDK_HYPER_MASK }, // hyper (since 2.10)
{ "META", GDK_META_MASK }, // meta (since 2.10)
{ NULL, 0 }
{ NULL, NULL }
};

/* construct a hash from the var_name_to_ptr array for quick access */
Expand Down Expand Up @@ -579,7 +579,8 @@ setup_scanner() {
uzbl.scan = g_scanner_new(&scan_config);
while(symp->symbol_name) {
g_scanner_scope_add_symbol(uzbl.scan, 0,
symp->symbol_name, (gulong*)&(symp->symbol_token));
symp->symbol_name,
GINT_TO_POINTER(symp->symbol_token));
symp++;
}
}
Expand All @@ -591,14 +592,14 @@ expand_template(const char *template) {
GTokenType token = G_TOKEN_NONE;
GString *ret = g_string_new("");
char *buf=NULL;
gulong sym;
int sym;

g_scanner_input_text(uzbl.scan, template, strlen(template));
while(!g_scanner_eof(uzbl.scan) && token != G_TOKEN_LAST) {
token = g_scanner_get_next_token(uzbl.scan);

if(token == G_TOKEN_SYMBOL) {
sym = *((gulong*)g_scanner_cur_value(uzbl.scan).v_int);
sym = (int)g_scanner_cur_value(uzbl.scan).v_symbol;
switch(sym) {
case SYM_URI:
g_string_append(ret,
Expand Down Expand Up @@ -773,12 +774,12 @@ setup_regex() {
static gboolean
get_var_value(gchar *name) {
void **p = NULL;

if( (p = g_hash_table_lookup(uzbl.comm.proto_var, name)) ) {
if(var_is("status_format", name)
|| var_is("useragent", name)) {
printf("VAR: %s VALUE: %s\n", name, (char *)*p);
} else printf("VAR: %s VALUE: %d\n", name, *((int *)p));
} else printf("VAR: %s VALUE: %d\n", name, (int)*p);
}
return TRUE;
}
Expand Down
2 changes: 1 addition & 1 deletion uzbl.h
Expand Up @@ -27,7 +27,7 @@ enum {

const struct {
gchar *symbol_name;
gulong symbol_token;
guint symbol_token;
} symbols[] = {
{"NAME", SYM_NAME},
{"URI", SYM_URI},
Expand Down

0 comments on commit ba6aeb5

Please sign in to comment.