New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation with clang, work around double free #6

Merged
merged 2 commits into from Mar 9, 2013
Jump to file or symbol
Failed to load files and symbols.
+15 −15
Diff settings

Always

Just for now

Viewing a subset of changes. View all
Prev

Enable compilation with clang

Some functions that ought to return a value call return without any value. This
commit adds a dummy value to each of those returns so that clang stops
complaining.
  • Loading branch information...
fuzxxl committed Mar 9, 2013
commit a00b1bdd48a286a8b6d6a513eb933838ce6cfae4
View
@@ -741,13 +741,13 @@ XGCValues values;
hw->html.bgclip_SAVE=None;
if (NoBodyImages(hw)) {
return;
return 0;
}
/* ??? Why is this here? */
hw->html.view->core.background_pixel = hw->html.background_SAVE ;
return;
return 0;
}
int NoBodyImages(Widget w) {
@@ -770,7 +770,7 @@ unsigned long valuemask;
XGCValues values;
if (!bgname || !*bgname || !(hw->html.drawGC)) {
return;
return 0;
}
if (hw->html.delay_images==True || currently_delaying_images==1) {
@@ -814,7 +814,7 @@ XGCValues values;
}
}
return;
return 0;
}
@@ -832,7 +832,7 @@ hw_do_color(Widget w, char *att, char *cname)
int i;
if (!att || !*att || !cname || !*cname) {
return;
return -1;
}
cmap = hw->core.colormap;
@@ -847,14 +847,14 @@ hw_do_color(Widget w, char *att, char *cname)
if(!allocated){
if(*val=='#') val++;
if (!*val) {
return;
return -1;
}
if (strlen(val)>=6) {
/* Must be valid hex */
for (i=0; i<6; i++) {
if (!strchr("0123456789AaBbCcDdEeFf",val[i])) {
return;
return -1;
}
}
@@ -875,10 +875,10 @@ hw_do_color(Widget w, char *att, char *cname)
col.flags = DoRed | DoGreen | DoBlue;
if (!XAllocColor(XtDisplay(w),cmap,&col)) {
return;
return -1;
}
} else {
return;
return -1;
}
}
@@ -910,7 +910,7 @@ hw_do_color(Widget w, char *att, char *cname)
hw->html.activeAnchor_fg = col.pixel;
}
return;
return -1;
}
void
View
@@ -2706,7 +2706,7 @@ int extra;
if ((*mptr)->is_end) {
/* end of table */
return;
return 0;
}
extra = 10;
@@ -2715,7 +2715,7 @@ int extra;
SetElement(hw, E_TABLE, currentFont, *x, *y, (char *) mptr, NULL, NULL, IMAGE_DEFAULT_BORDER);
if (!Current->table_data) {
/* no table */
return;
return 0;
}
Current->alignment = ALIGN_MIDDLE;
Current->width = Current->table_data->width;
View
@@ -1078,11 +1078,11 @@ int baseLine;
int yy;
if (field->type == F_NONE) { /* nothing to display in field */
return;
return -1;
}
if (field->type != F_TEXT) { /* routine only does text at this time */
return;
return -1;
}
/* adjust for aesthetic surounding space */
View
@@ -960,7 +960,7 @@ int NNTPgetarthdrs(char *art,char **ref, char **grp, char **subj, char **from)
char ch = *p++ = HTGetCharacter ();
if (ch==(char)EOF) {
abort_socket(); /* End of file, close socket */
return; /* End of file on response */
return -1; /* End of file on response */
}
if ((ch == LF)
ProTip! Use n and p to navigate between commits in a pull request.