History

get rid of casts, rename dircmp

Benjamin Scher Purcell committed 11 years ago

Commit b79cb571 parent 5b84dc81 file · +6 −6Browse files

Unified · Split

9p.c+6−6
@@ -388,12 +388,12 @@ dirpackage(uchar *buf, u32int ts, Dir **d) · 387 unmodified lines
388}388}
389 389
390int390int
391Dircmp(const void *v1, const void *v2)391dircmp(const void *v1, const void *v2)
392{392{
393 Dir *e, *d;393 const Dir *e, *d;
394 394
395 e = (Dir*)v1;395 e = v1;
396 d = (Dir*)v2;396 d = v2;
397 397
398 return strcmp(e->name, d->name);398 return strcmp(e->name, d->name);
399}399}
@@ -425,7 +425,7 @@ _9pdirread(FFid *f, Dir **d) · 25 unmodified lines
425 if((fdir = lookupdir(f->path, PUT)) != NULL){425 if((fdir = lookupdir(f->path, PUT)) != NULL){
426 fdir->dirs = *d;426 fdir->dirs = *d;
427 fdir->ndirs = ts;427 fdir->ndirs = ts;
428 qsort(fdir->dirs, fdir->ndirs, sizeof(*fdir->dirs), Dircmp);428 qsort(fdir->dirs, fdir->ndirs, sizeof(*fdir->dirs), dircmp);
429 }429 }
430 free(buf);430 free(buf);
431 return ts;431 return ts;
@@ -622,7 +622,7 @@ isdircached(const char *path) · 190 unmodified lines
622 return NULL;622 return NULL;
623 }623 }
624 e.name = bname;624 e.name = bname;
625 d = bsearch(&e, fd->dirs, fd->ndirs, sizeof(*fd->dirs), Dircmp);625 d = bsearch(&e, fd->dirs, fd->ndirs, sizeof(*fd->dirs), dircmp);
626 free(dname);626 free(dname);
627 return d;627 return d;
628}628}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t