[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55045] trunk/blender/source/blender/ blenlib/intern/storage.c: code cleanup: remove unused argument from bli_builddir
Campbell Barton
ideasman42 at gmail.com
Tue Mar 5 08:36:31 CET 2013
Revision: 55045
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55045
Author: campbellbarton
Date: 2013-03-05 07:36:30 +0000 (Tue, 05 Mar 2013)
Log Message:
-----------
code cleanup: remove unused argument from bli_builddir
Modified Paths:
--------------
trunk/blender/source/blender/blenlib/intern/storage.c
Modified: trunk/blender/source/blender/blenlib/intern/storage.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/storage.c 2013-03-05 07:02:59 UTC (rev 55044)
+++ trunk/blender/source/blender/blenlib/intern/storage.c 2013-03-05 07:36:30 UTC (rev 55045)
@@ -215,11 +215,8 @@
/**
* Scans the directory named *dirname and appends entries for its contents to files.
- * Recorded pathnames will be prefixed by *relname if specified (FIXME: actually this
- * option is not used anywhere, might as well get rid of it).
*/
-static void bli_builddir(const char *dirname, const char *relname,
- struct BuildDirCtx *dir_ctx)
+static void bli_builddir(struct BuildDirCtx *dir_ctx, const char *dirname)
{
struct ListBase dirbase = {NULL, NULL};
int newnum = 0;
@@ -227,26 +224,14 @@
if ((dir = opendir(dirname)) != NULL) {
- {
- const struct dirent *fname;
- int rellen;
- char buf[PATH_MAX];
- BLI_strncpy(buf, relname, sizeof(buf));
- rellen = strlen(relname);
-
- if (rellen) {
- buf[rellen] = '/';
- rellen++;
+ const struct dirent *fname;
+ while ((fname = readdir(dir)) != NULL) {
+ struct dirlink * const dlink = (struct dirlink *)malloc(sizeof(struct dirlink));
+ if (dlink != NULL) {
+ dlink->name = BLI_strdup(fname->d_name);
+ BLI_addhead(&dirbase, dlink);
+ newnum++;
}
- while ((fname = readdir(dir)) != NULL) {
- struct dirlink * const dlink = (struct dirlink *)malloc(sizeof(struct dirlink));
- if (dlink != NULL) {
- BLI_strncpy(buf + rellen, fname->d_name, sizeof(buf) - rellen);
- dlink->name = BLI_strdup(buf);
- BLI_addhead(&dirbase, dlink);
- newnum++;
- }
- }
}
if (newnum) {
@@ -449,7 +434,7 @@
dir_ctx.nrfiles = 0;
dir_ctx.files = NULL;
- bli_builddir(dirname, "", &dir_ctx);
+ bli_builddir(&dir_ctx, dirname);
bli_adddirstrings(&dir_ctx);
if (dir_ctx.files) {
More information about the Bf-blender-cvs
mailing list