Closed GoogleCodeExporter closed 9 years ago
Adding Release1.1 tag. I will do this review today.
Original comment by harr...@gmail.com
on 24 Jun 2009 at 9:47
Original comment by harr...@gmail.com
on 24 Jun 2009 at 11:57
Thanks for writing this. Here is my review. The code is very clean. I have
some high level structural
comments.
Setting status to Started, and adding Stanley as an owner. Stanley, when you
have addressed all 5 of the
below issues, please mark "fixed" and assign back to me to verify. You can go
ahead and check in the fix to
cudpp_testrig too.
0. Are you sure this functionality doesn't already exist at a higher level in
each OS? If so, we don't need all
this code. If not, then I guess we do.
1. This should be moved to common -- it should not be in cudpp_testrig. That
way I can use it for satGL and
we can use it for other samples.
2. The correct check for Apple OS X should be "#if defined (__APPLE__) ||
defined(MACOSX)"
3. The only prototypes needed in tools.h are
//wrapper functions for the whole routine
int findDir(char * startDir, char * dirName, char * outputPath);
int findFile(char * startDir, char * dirName, char * outputPath);
These other prototypes should be removed from tools.h as they are only used
internally by the functions
above (public vs. private interface)
4. You currently have
#if defined (__linux__) || defined (__APPLE__)
//linux functions here
#else
//windows functions here
#endif
I think that should be:
#if defined (__linux__) || defined (__APPLE__) || defined (MACOSX)
//linux functions here
#elif defined (WIN32) || defined (__WIN32)
//windows functions here
#else
// error unimplemented OS functionality
#error "No implementation for this OS in tools.cpp"
#endif
You can't assume that any non-linux or apple functionality will use the windows
implementation!
5. You don't need a comment at the end of each if statement, especially short
ones like this. It just adds
clutter.
if(strcmp(curDir, target) == 0)
{
haveSeen = true;
} //end if(strcmp(curDir, target) == 0)
Original comment by harr...@gmail.com
on 25 Jun 2009 at 12:08
Thank you for the feedback. I will make the changes soon.
Just to clarify, if it goes into common, should I make it part of the cutil
library?
Original comment by Solgood...@gmail.com
on 25 Jun 2009 at 4:13
No. As I said before, I believe cutil already has (a simpler version of) this
functionality. Which is why I'm surprised you wrote it all from scratch.
Just put the files in /common.
Original comment by harr...@gmail.com
on 25 Jun 2009 at 4:31
If the functionality is already there shouldn't we just use it instead of
adding more code and maintenance
headache (I am lazy :) )
Original comment by shu...@gmail.com
on 25 Jun 2009 at 4:36
I'm not sure if the functionality is in the really old CUTIL that we use in
CUDPP or
the new one in the SDK. And like I say, it is simpler -- it searches a couple
of
fixed locations where the SDK samples keep data, rather than recursively
searching a
whole tree.
The former is what I suggested Stanley do, but hey, if he wants to go write a
whole
file searching library, who am I to stop him? :)
I do hope we can eventually strip down the CUTIL functionality we use to
something
simpler and more maintainable and drop the rest of it. Right now we are way
out of
date with CUTIL anyway. So I don't mind having something standalone like this.
Original comment by harr...@gmail.com
on 25 Jun 2009 at 4:55
I added the functionality because the ones in cutil was not general enough.
Making
it more general fixes issue 3. Issue 3 is also caused by the current working
directory differing from the relative path. What I did was to make sure no
matter
where you are in the repository you can always run the testrig and it will
always
find the files. Besides it was a good exercise in learning POSIX and Win32
directory
structures and in the future if anyone else needs files for some testrig, then
we
have a good finder here :)
Original comment by Solgood...@gmail.com
on 25 Jun 2009 at 5:15
5595 Adds tools.h and tools.cpp back to /cudpp_testrig. Awaiting verification.
Original comment by Solgood...@gmail.com
on 26 Jun 2009 at 12:29
Looks good. Added the correct files to the vcproj and removed a windows
warning.
Marking verified. Thanks Stanley.
Original comment by harr...@gmail.com
on 26 Jun 2009 at 3:25
Reopening this. Stanley, on win32 cudpp_testrig fails to link. Also, more
along the
lines of the code review:
The non-output parameters to findDir and findFile should be const char *, not
char*.
However, looking at the code, it seems to modify these non-output input parameters.
That's a big no-no. Please fix this.
Original comment by harr...@gmail.com
on 26 Jun 2009 at 3:41
It fails to link in emurelease and emudebug. release and debug link fine.
Please
fix the emu linking.
Original comment by harr...@gmail.com
on 26 Jun 2009 at 3:42
Original comment by harr...@gmail.com
on 26 Jun 2009 at 4:00
I fixed the const char * issue. The linking problem is still there though.
Original comment by harr...@gmail.com
on 26 Jun 2009 at 4:04
Added extern "C" to the header file fixed the linking issue. Thanks for
catching that.
Stanley
Original comment by Solgood...@gmail.com
on 26 Jun 2009 at 4:59
Verified. Thanks.
Original comment by harr...@gmail.com
on 26 Jun 2009 at 5:05
Original issue reported on code.google.com by
Solgood...@gmail.com
on 24 Jun 2009 at 12:27