]> git.sesse.net Git - vlc/blobdiff - src/symbian/path.cpp
input: use unsigned atomic value
[vlc] / src / symbian / path.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 650be89..f0094dd
@@ -3,31 +3,28 @@
  *****************************************************************************
  * Copyright © 2010 Pankaj Yadav
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
  * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include <f32file.h>
-#include <e32base.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <wchar.h>
-#include <string.h>
-#include <utf.h>
+#include <f32file.h>    /* RFs */
+#include <string.h>     /* strlen */
+#include <utf.h>        /* CnvUtfConverter */
 
-#include "path.h"
+extern "C" {
+    #include "path.h"
+}
 
 /*Way to Find AppPrivatePath (A Path where an application can store its private data) */
 static TInt GetPrivatePath(TFileName& privatePath)
@@ -62,33 +59,28 @@ extern "C" char * GetConstPrivatePath(void)
     size_t len;
     char carray[KMaxFileName];
 
-    if(GetPrivatePath(privatePath)!=KErrNone)
+    if (GetPrivatePath(privatePath) != KErrNone)
     {
-        goto defaultreturn;
+        return strdup("C:\\Data\\Others");
     }
 
     CnvUtfConverter::ConvertFromUnicodeToUtf8( privatepathutf8, privatePath );
 
     TInt index = 0;
-    for(index =0 ; index < privatepathutf8.Length(); index++)
+    for (index = 0; index < privatepathutf8.Length(); index++)
     {
         carray[index] = privatepathutf8[index];
     }
     carray[index] = 0;
 
-    if((len = strnlen((const char *)carray, KMaxFileName) < KMaxFileName)
+    if ((len = strnlen((const char *)carray, KMaxFileName) < KMaxFileName))
     {
-        carray[len-1]='\0';
+        carray[len-1] = '\0';
+        return strdup((const char *)carray);
     }
     else
     {
-        goto defaultreturn;
+        return strdup("C:\\Data\\Others");
     }
-
-
-    return strdup((const char *)carray);
-
-defaultreturn:
-    return strdup("C:\\Data\\Others");
 }