Browse Source

cleaned up some coding convention things

master
mort 9 years ago
parent
commit
e5cb0b4156
3 changed files with 10 additions and 8 deletions
  1. 1
    1
      src/cms_err.c
  2. 2
    2
      src/cms_util.c
  3. 7
    5
      src/main.c

+ 1
- 1
src/cms_err.c View File

@@ -40,7 +40,7 @@ static char* get_error_message(cms_err err)

void _cms_err_panic(cms_err err, char* msg, const char* file, int line)
{
if (err == CMS_ERR_NONE)
if (!err)
return;

#ifdef DEBUG

+ 2
- 2
src/cms_util.c View File

@@ -98,13 +98,13 @@ cms_err cms_util_dir_copy_recursive(char* dir1, char* dir2)
if (S_ISDIR(st->st_mode))
{
cms_err err = cms_util_dir_copy_recursive(path1, path2);
if (err != CMS_ERR_NONE)
if (err)
return err;
}
else
{
cms_err err = cms_util_file_copy(path1, path2);
if (err != CMS_ERR_NONE)
if (err)
return err;
}
}

+ 7
- 5
src/main.c View File

@@ -33,13 +33,15 @@ int main(int argc, char** argv)
cms_err_panic(CMS_ERR_INITED, NULL);

//Copy files from resources
cms_err_panic(
cms_util_dir_copy_recursive(CMS_FILE_RESOURCES, dirname),
dirname
);
cms_err err;
err = cms_util_dir_copy_recursive(CMS_FILE_RESOURCES, dirname);
if (err)
cms_err_panic(err, dirname);

//Create .cmsinited file
cms_err_panic(cms_util_file_create(initedPath), initedPath);
err = cms_util_file_create(initedPath);
if (err)
cms_err_panic(err, initedPath);
}

//Build

Loading…
Cancel
Save