mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Silence warnings produces by -Wall -pedantic
This commit is contained in:
parent
5ea09a105d
commit
4af6344a4b
@ -52,6 +52,8 @@ bool EDE_Browser::sortfn(char*s1,char*s2,SortType type) {
|
||||
return false;
|
||||
case FILE_SIZE_SORT:
|
||||
return (sizetof(s1)>sizetof(s2));
|
||||
default:
|
||||
return false; // NO_SORT
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,9 +129,9 @@ void EDE_Browser::sort(int column, SortType type, bool reverse) {
|
||||
int col=0;
|
||||
if (sort_type != NO_SORT) {
|
||||
bool found=false;
|
||||
while (delim=strchr(h, colchar)) {
|
||||
while ((delim=strchr(h, colchar))) {
|
||||
if (col==sort_column) {
|
||||
for (int i=0; i<=strlen(delim); i++) delim[i-SYMLEN+1]=delim[i];
|
||||
for (uint i=0; i<=strlen(delim); i++) delim[i-SYMLEN+1]=delim[i];
|
||||
found=true;
|
||||
break;
|
||||
}
|
||||
@ -153,7 +155,7 @@ void EDE_Browser::sort(int column, SortType type, bool reverse) {
|
||||
|
||||
// Find column
|
||||
bool found=false;
|
||||
while (delim=strchr(h, colchar)) {
|
||||
while ((delim=strchr(h, colchar))) {
|
||||
if (col==column) {
|
||||
*delim='\0';
|
||||
snprintf(newheader,hlen+SYMLEN,"%s%s\t%s",column_header_,sym,delim+1);
|
||||
@ -181,7 +183,7 @@ void EDE_Browser::sort(int column, SortType type, bool reverse) {
|
||||
char *tmp = strdup(text(i));
|
||||
char *l = tmp;
|
||||
int col=0;
|
||||
while (delim=strchr(l, Fl_Icon_Browser::column_char())) {
|
||||
while ((delim=strchr(l, Fl_Icon_Browser::column_char()))) {
|
||||
*delim = '\0';
|
||||
if (col==column) break;
|
||||
l=delim+1;
|
||||
@ -475,9 +477,9 @@ int EDE_Browser::Heading::handle(int event) {
|
||||
case FL_ENTER:
|
||||
case FL_PUSH: {
|
||||
int mindx = 100;
|
||||
int mindy = 100;
|
||||
int oldx = 0;
|
||||
int oldy = 0;
|
||||
// int mindy = 100;
|
||||
// int oldx = 0;
|
||||
// int oldy = 0;
|
||||
|
||||
Fl_Widget*const* a = array();
|
||||
|
||||
|
@ -316,12 +316,12 @@ bool DirTree::set_current(const char* path) {
|
||||
// to the given path
|
||||
// If parent is given, only entries below it will be scanned
|
||||
int DirTree::find_best_match(const char* path, int parent) {
|
||||
int bestlen=0;
|
||||
uint bestlen=0;
|
||||
int bestindex=-1;
|
||||
for (int i=parent; i<=size(); i++) {
|
||||
if ((i!=parent) && (indent(i)<=indent(parent))) break;
|
||||
char* d = (char*)data(i);
|
||||
int len = strlen(d);
|
||||
uint len = strlen(d);
|
||||
if ((len>bestlen) && (strncmp((char*)path, d, len)==0)) {
|
||||
bestlen=len;
|
||||
bestindex=i;
|
||||
|
@ -167,7 +167,8 @@ private:
|
||||
void** items;
|
||||
int size, capacity;
|
||||
public:
|
||||
Bucket() : size(0), capacity(1000), items((void**)malloc(sizeof(void*)*1000)) {
|
||||
Bucket() : size(0), capacity(1000) {
|
||||
items = (void**)malloc(sizeof(void*)*capacity);
|
||||
for (int i=0; i<capacity; i++) items[i]=0;
|
||||
}
|
||||
~Bucket() { empty(); free(items); }
|
||||
@ -204,7 +205,6 @@ public:
|
||||
column_widths(cw);
|
||||
column_char('\t');
|
||||
column_header("Name\tType\tSize\tDate\tPermissions");
|
||||
textsize(12); // FIXME: hack for font size
|
||||
const SortType st[]={ALPHA_CASE_SORT, ALPHA_CASE_SORT, FILE_SIZE_SORT, DATE_SORT, ALPHA_SORT, NO_SORT};
|
||||
column_sort_types(st);
|
||||
when(FL_WHEN_ENTER_KEY_ALWAYS);
|
||||
@ -214,7 +214,6 @@ public:
|
||||
editbox_ = new EditBox(0, 0, 0, 0);
|
||||
editbox_->box(FL_BORDER_BOX);
|
||||
editbox_->parent(this);
|
||||
editbox_->textsize(12); // FIXME: hack for font size
|
||||
editbox_->hide();
|
||||
|
||||
rename_callback_ = 0;
|
||||
|
@ -811,7 +811,7 @@ void Fl_Icon_Browser::collapse_all() {
|
||||
if (!l) return;
|
||||
do {
|
||||
collapse(l);
|
||||
} while (l=l->next);
|
||||
} while ((l=l->next));
|
||||
redraw_lines();
|
||||
}
|
||||
|
||||
@ -820,7 +820,7 @@ void Fl_Icon_Browser::expand_all() {
|
||||
if (!l) return;
|
||||
do {
|
||||
collapse(l);
|
||||
} while (l=l->next);
|
||||
} while ((l=l->next));
|
||||
redraw();
|
||||
}
|
||||
|
||||
@ -841,7 +841,7 @@ void Fl_Icon_Browser::toggle_collapse(void* lp) {
|
||||
if (p->level <=l->level) break;
|
||||
if ((p->flags & NOTDISPLAYED) && (p->level==l->level+1))
|
||||
invisibles=true;
|
||||
} while (p=p->next);
|
||||
} while ((p=p->next));
|
||||
|
||||
if (invisibles)
|
||||
expand(l);
|
||||
|
@ -72,7 +72,7 @@ int ede_ask(const char*fmt, ...) {
|
||||
w->box(FL_NO_BOX);
|
||||
|
||||
va_start(ap,fmt);
|
||||
int c=fl_ask(fmt);
|
||||
int c=fl_choice(fmt, fl_yes, fl_no, 0);
|
||||
va_end(ap);
|
||||
return c;
|
||||
}
|
||||
|
@ -473,7 +473,7 @@ fprintf (stderr, "location_input_cb %d\n",Fl::event());
|
||||
|
||||
const char* loc = location_input->value(); // shortcut
|
||||
if (strlen(loc)<1 || loc[strlen(loc)-1]=='/') return;
|
||||
int pos = location_input->position();
|
||||
uint pos = location_input->position();
|
||||
if (pos!=strlen(loc)) return; // cursor in the middle
|
||||
int mark = location_input->mark();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user