fixed some compilation under ubuntu

This commit is contained in:
Anatoly Baksheev
2011-02-04 18:29:05 +00:00
parent 21f0d1e174
commit 7b1c265563
9 changed files with 141 additions and 101 deletions
+6 -2
View File
@@ -73,7 +73,7 @@ void ncvDebugOutput(const char *msg, ...)
char buffer[K_DEBUG_STRING_MAXLEN];
va_list args;
va_start(args, msg);
vsnprintf_s(buffer, K_DEBUG_STRING_MAXLEN, K_DEBUG_STRING_MAXLEN-1, msg, args);
vsnprintf(buffer, K_DEBUG_STRING_MAXLEN, msg, args);
va_end (args);
debugOutputHandler(buffer);
}
@@ -531,6 +531,10 @@ typedef struct _NcvTimeMoment NcvTimeMoment;
return (((double)t2->tv.tv_sec - (double)t1->tv.tv_sec) * 1000000 + (double)t2->tv.tv_usec - (double)t1->tv.tv_usec);
}
double _ncvMomentsDiffToMilliseconds(NcvTimeMoment *t1, NcvTimeMoment *t2)
{
return ((double)t2->tv.tv_sec - (double)t1->tv.tv_sec) * 1000;
}
#endif //#if defined(_WIN32) || defined(_WIN64)
@@ -569,4 +573,4 @@ double ncvEndQueryTimerMs(NcvTimer t)
return res;
}
#endif /* !defined (HAVE_CUDA) */
#endif /* !defined (HAVE_CUDA) */
@@ -146,10 +146,10 @@ namespace NCVRuntimeTemplateBool
{
//Convenience function used by the user
//Takes a variable argument list, transforms it into a list
static void call(Func &functor, int dummy, ...)
static void call(Func &functor, Ncv32u dummy, ...)
{
//Vector used to collect arguments
std::vector<int> templateParamList;
std::vector<NcvBool> templateParamList;
//Variable argument list manipulation
va_list listPointer;
@@ -157,7 +157,7 @@ namespace NCVRuntimeTemplateBool
//Collect parameters into the list
for(int i=0; i<NumArguments; i++)
{
int val = va_arg(listPointer, int);
NcvBool val = va_arg(listPointer, NcvBool);
templateParamList.push_back(val);
}
va_end(listPointer);
@@ -168,26 +168,26 @@ namespace NCVRuntimeTemplateBool
//Actual function called recursively to build a typelist based
//on a list of values
static void call( Func &functor, std::vector<int> &templateParamList)
static void call( Func &functor, std::vector<NcvBool> &templateParamList)
{
//Get current parameter value in the list
int val = templateParamList[templateParamList.size() - 1];
NcvBool val = templateParamList[templateParamList.size() - 1];
templateParamList.pop_back();
//Select the compile time value to add into the typelist
//depending on the runtime variable and make recursive call.
//depending on the runtime variable and make recursive call.
//Both versions are really instantiated
if(val)
if (val)
{
KernelCaller<
Loki::Typelist<typename Loki::Int2Type<true>, TList >,
Loki::Typelist<typename Loki::Int2Type<1>, TList >,
NumArguments-1, Func >
::call(functor, templateParamList);
}
else
{
KernelCaller<
Loki::Typelist<typename Loki::Int2Type<false>, TList >,
KernelCaller<
Loki::Typelist<typename Loki::Int2Type<0>, TList >,
NumArguments-1, Func >
::call(functor, templateParamList);
}
@@ -205,7 +205,7 @@ namespace NCVRuntimeTemplateBool
functor.call(TList()); //TList instantiated to get the method template parameter resolved
}
static void call(Func &functor, std::vector<int> &templateParams)
static void call(Func &functor, std::vector<NcvBool> &templateParams)
{
functor.call(TList());
}