diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-01-02 21:01:38 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-01-02 21:01:38 +0100 |
commit | f7d30133221896638f7bf4f66c504255c4b14f48 (patch) | |
tree | 5f3e07a049f388a3a309a615b8884318f6668a98 /nsprpub/pr/src/io/prdir.c | |
parent | 26b297510a11758727438df4669357a2a2bc42ce (diff) | |
download | UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.gz UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.lz UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.xz UXP-f7d30133221896638f7bf4f66c504255c4b14f48.zip |
Issue #1338 - Part 1: Update NSPR to 4.24
Diffstat (limited to 'nsprpub/pr/src/io/prdir.c')
-rw-r--r-- | nsprpub/pr/src/io/prdir.c | 92 |
1 files changed, 50 insertions, 42 deletions
diff --git a/nsprpub/pr/src/io/prdir.c b/nsprpub/pr/src/io/prdir.c index 3701a6a4b..365afefd2 100644 --- a/nsprpub/pr/src/io/prdir.c +++ b/nsprpub/pr/src/io/prdir.c @@ -18,8 +18,8 @@ PR_IMPLEMENT(PRDir*) PR_OpenDir(const char *name) return NULL; } } else { - PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); - } + PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); + } return dir; } @@ -33,51 +33,57 @@ PR_IMPLEMENT(PRDirEntry*) PR_ReadDir(PRDir *dir, PRDirFlags flags) PR_IMPLEMENT(PRStatus) PR_CloseDir(PRDir *dir) { -PRInt32 rv; + PRInt32 rv; if (dir) { rv = _PR_MD_CLOSE_DIR(&dir->md); - PR_DELETE(dir); - if (rv < 0) { - return PR_FAILURE; - } else - return PR_SUCCESS; + PR_DELETE(dir); + if (rv < 0) { + return PR_FAILURE; + } else { + return PR_SUCCESS; + } } - return PR_SUCCESS; + return PR_SUCCESS; } PR_IMPLEMENT(PRStatus) PR_MkDir(const char *name, PRIntn mode) { -PRInt32 rv; + PRInt32 rv; - rv = _PR_MD_MKDIR(name, mode); - if (rv < 0) { - return PR_FAILURE; - } else - return PR_SUCCESS; + rv = _PR_MD_MKDIR(name, mode); + if (rv < 0) { + return PR_FAILURE; + } else { + return PR_SUCCESS; + } } PR_IMPLEMENT(PRStatus) PR_MakeDir(const char *name, PRIntn mode) { -PRInt32 rv; - - if (!_pr_initialized) _PR_ImplicitInitialization(); - rv = _PR_MD_MAKE_DIR(name, mode); - if (rv < 0) { - return PR_FAILURE; - } else - return PR_SUCCESS; + PRInt32 rv; + + if (!_pr_initialized) { + _PR_ImplicitInitialization(); + } + rv = _PR_MD_MAKE_DIR(name, mode); + if (rv < 0) { + return PR_FAILURE; + } else { + return PR_SUCCESS; + } } PR_IMPLEMENT(PRStatus) PR_RmDir(const char *name) { -PRInt32 rv; + PRInt32 rv; - rv = _PR_MD_RMDIR(name); - if (rv < 0) { - return PR_FAILURE; - } else - return PR_SUCCESS; + rv = _PR_MD_RMDIR(name); + if (rv < 0) { + return PR_FAILURE; + } else { + return PR_SUCCESS; + } } #ifdef MOZ_UNICODE @@ -85,7 +91,7 @@ PRInt32 rv; * UTF16 Interface */ PR_IMPLEMENT(PRDirUTF16*) PR_OpenDirUTF16(const PRUnichar *name) -{ +{ PRDirUTF16 *dir; PRStatus sts; @@ -100,10 +106,10 @@ PR_IMPLEMENT(PRDirUTF16*) PR_OpenDirUTF16(const PRUnichar *name) PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); } return dir; -} - +} + PR_IMPLEMENT(PRDirEntryUTF16*) PR_ReadDirUTF16(PRDirUTF16 *dir, PRDirFlags flags) -{ +{ /* * _MD_READ_DIR_UTF16 return a PRUnichar* to the name; allocation in * machine-dependent code @@ -111,20 +117,22 @@ PR_IMPLEMENT(PRDirEntryUTF16*) PR_ReadDirUTF16(PRDirUTF16 *dir, PRDirFlags flags PRUnichar* name = _PR_MD_READ_DIR_UTF16(&dir->md, flags); dir->d.name = name; return name ? &dir->d : NULL; -} - +} + PR_IMPLEMENT(PRStatus) PR_CloseDirUTF16(PRDirUTF16 *dir) -{ - PRInt32 rv; +{ + PRInt32 rv; if (dir) { rv = _PR_MD_CLOSE_DIR_UTF16(&dir->md); PR_DELETE(dir); - if (rv < 0) - return PR_FAILURE; - else - return PR_SUCCESS; - } + if (rv < 0) { + return PR_FAILURE; + } + else { + return PR_SUCCESS; + } + } return PR_SUCCESS; } |