[vlc-devel] [PATCH 1/4] Symbian Applications Directory for private path
Jean-Baptiste Kempf
jb at videolan.org
Sun Jan 9 15:04:26 CET 2011
Hello,
thanks for the split.
On Sun, Jan 09, 2011 at 01:31:27AM +0530, Pankaj yadav wrote :
> ---
> src/symbian/path.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> src/symbian/path.h | 31 +++++++++++++++++++++++++++++
> 2 files changed, 85 insertions(+), 0 deletions(-)
Missing Makefile.am modification, no?
> +/*Way to Find AppPrivatePath (A Path where an application can store its private data) */
> +TInt GetPrivatePath(TFileName& privatePath)
> +{
> + TFileName KPath;
> + RFs fsSession;
> + TInt result;
break a line, here
> + result = fsSession.Connect();
> + if (result != KErrNone){return result;}
Deinline the { }, K&R or VLC style,
> + fsSession.PrivatePath(KPath);
> + TFindFile findFile(fsSession);
Break a line, here
> + privatePath = KPath;
> + result = findFile.FindByDir(KPath, KNullDesC);
> + if (result == KErrNone){privatePath = findFile.File();}
As above..
> + fsSession.Close();
> + return result;
> +}
> +char * GetConstPrivatePath()
> +{
> + TFileName privatePath;
> + size_t ret;
> + char carray[KMaxFileName];
Breaj a line here,
> + if(GetPrivatePath(privatePath)!=KErrNone){return strdup("C:\\Data\\Others");}
> + ret = wcstombs(carray, (const wchar_t *)privatePath.PtrZ(), KMaxFileName );
Here too.
No check on ret?
> + /*clean the Path*/
> + int i=0;
> + while(carray[i]!='\0' && i<=KMaxFileName){i++;}
> + if(i>KMaxFileName){return strdup("C:\\Data\\Others");}
> + if(carray[i-1]=='\\'){carray[i-1]='\0';}
> + return strdup((const char *)carray);
> +}
Same as above.
Seriously, you should care a bit more about your coding style, and
commenting of the code.
Best Regards,
--
Jean-Baptiste Kempf
http://www.jbkempf.com/
+33 672 704 734
More information about the vlc-devel
mailing list