Revision: 7337 http://playerstage.svn.sourceforge.net/playerstage/?rev=7337&view=rev Author: gbiggs Date: 2009-02-17 00:56:38 +0000 (Tue, 17 Feb 2009)
Log Message: ----------- Fixes for compilation on SunStudio Modified Paths: -------------- code/player/trunk/cmake/internal/SearchForStuff.cmake code/player/trunk/server/drivers/blobfinder/upcbarcode/upcbarcode.cc code/player/trunk/server/drivers/camera/v4l/v4lcapture.c code/player/trunk/server/drivers/camera/v4l/v4lcapture.h code/player/trunk/server/drivers/localization/amcl/pf/pf_vector.c code/player/trunk/server/drivers/mixed/rflex/CMakeLists.txt code/player/trunk/server/drivers/rfid/skyetekM1.cc Modified: code/player/trunk/cmake/internal/SearchForStuff.cmake =================================================================== --- code/player/trunk/cmake/internal/SearchForStuff.cmake 2009-02-16 01:59:06 UTC (rev 7336) +++ code/player/trunk/cmake/internal/SearchForStuff.cmake 2009-02-17 00:56:38 UTC (rev 7337) @@ -61,13 +61,13 @@ SET (CMAKE_REQUIRED_LIBRARIES dl) CHECK_LIBRARY_EXISTS (ltdl lt_dlopenext "${PLAYER_EXTRA_LIB_DIRS}" HAVE_LIBLTDL) SET (CMAKE_REQUIRED_LIBRARIES) -IF (PLAYER_OS_SUN) +IF (PLAYER_OS_SOLARIS) SET (CMAKE_REQUIRED_LIBRARIES rt) CHECK_FUNCTION_EXISTS (nanosleep HAVE_NANOSLEEP) SET (CMAKE_REQUIRED_LIBRARIES) -ELSE (PLAYER_OS_SUN) +ELSE (PLAYER_OS_SOLARIS) CHECK_FUNCTION_EXISTS (nanosleep HAVE_NANOSLEEP) -ENDIF (PLAYER_OS_SUN) +ENDIF (PLAYER_OS_SOLARIS) CHECK_FUNCTION_EXISTS (poll HAVE_POLL) IF (PLAYER_OS_WIN) Modified: code/player/trunk/server/drivers/blobfinder/upcbarcode/upcbarcode.cc =================================================================== --- code/player/trunk/server/drivers/blobfinder/upcbarcode/upcbarcode.cc 2009-02-16 01:59:06 UTC (rev 7336) +++ code/player/trunk/server/drivers/blobfinder/upcbarcode/upcbarcode.cc 2009-02-17 00:56:38 UTC (rev 7337) @@ -225,7 +225,7 @@ //////////////////////////////////////////////////////////////////////////////// // Shutdown the device (called by server thread). -int UPCBarcode::MainQuit() +void UPCBarcode::MainQuit() { ImageBase::MainQuit(); @@ -252,8 +252,14 @@ width = this->stored_data.width; height = this->stored_data.height; - int symbols[height][2]; + int symbols[][2]; + if ((symbols = new int[height][2]) == NULL) + { + PLAYER_ERROR ("Failed to allocate memory for symbols in upcbarcode"); + return -1; + } + // Create input image if it doesnt exist if (this->inpImage == NULL) this->inpImage = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1); @@ -271,6 +277,7 @@ default: { PLAYER_WARN1("image format [%d] is not supported", this->stored_data.format); + delete[] symbols; return -1; } } @@ -299,7 +306,7 @@ for (x = 0; x < width; x += step_x) { // Extract raw symbols - symbol_count = this->ExtractSymbols(x, sizeof(symbols) / sizeof(symbols[0]), symbols); + symbol_count = this->ExtractSymbols(x, height * 2, symbols); // Identify barcode id = this->ExtractCode(symbol_count, symbols, &min, &max); @@ -345,6 +352,7 @@ WriteBlobfinderData(); + delete[] symbols; return 0; } Modified: code/player/trunk/server/drivers/camera/v4l/v4lcapture.c =================================================================== --- code/player/trunk/server/drivers/camera/v4l/v4lcapture.c 2009-02-16 01:59:06 UTC (rev 7336) +++ code/player/trunk/server/drivers/camera/v4l/v4lcapture.c 2009-02-17 00:56:38 UTC (rev 7337) @@ -442,7 +442,7 @@ if ((fg->picture.palette) == VIDEO_PALETTE_JPEG) { - buf = (unsigned char *)(fg->mb_map + fg->mbuf.offsets[fg->cur_frame]); + buf = ((unsigned char *)(fg->mb_map)) + fg->mbuf.offsets[fg->cur_frame]; insize = frame_get_size(fr) - sizeof(int); count = insize - 1; for (i = 1024; i < count; i++) @@ -459,7 +459,7 @@ { // Save video buffer into our own memory memcpy( fr->data, - fg->mb_map + fg->mbuf.offsets[fg->cur_frame], + ((unsigned char *)(fg->mb_map)) + fg->mbuf.offsets[fg->cur_frame], frame_get_size( fr ) ); } Modified: code/player/trunk/server/drivers/camera/v4l/v4lcapture.h =================================================================== --- code/player/trunk/server/drivers/camera/v4l/v4lcapture.h 2009-02-16 01:59:06 UTC (rev 7336) +++ code/player/trunk/server/drivers/camera/v4l/v4lcapture.h 2009-02-17 00:56:38 UTC (rev 7337) @@ -53,8 +53,10 @@ #include <sys/mman.h> #include <sys/ioctl.h> -#include <linux/fs.h> -#include <linux/kernel.h> +#if !defined (sun) + #include <linux/fs.h> + #include <linux/kernel.h> +#endif #include <linux/videodev.h> #include "v4lframe.h" Modified: code/player/trunk/server/drivers/localization/amcl/pf/pf_vector.c =================================================================== --- code/player/trunk/server/drivers/localization/amcl/pf/pf_vector.c 2009-02-16 01:59:06 UTC (rev 7336) +++ code/player/trunk/server/drivers/localization/amcl/pf/pf_vector.c 2009-02-17 00:56:38 UTC (rev 7337) @@ -14,7 +14,7 @@ #if defined (WIN32) #include <float.h> #define finite _finite -#elif defined (__sun) && defined (HAVE_IEEEFP_H) +#elif defined (sun) && defined (HAVE_IEEEFP_H) #include <ieeefp.h> #endif Modified: code/player/trunk/server/drivers/mixed/rflex/CMakeLists.txt =================================================================== --- code/player/trunk/server/drivers/mixed/rflex/CMakeLists.txt 2009-02-16 01:59:06 UTC (rev 7336) +++ code/player/trunk/server/drivers/mixed/rflex/CMakeLists.txt 2009-02-17 00:56:38 UTC (rev 7337) @@ -1,3 +1,4 @@ PLAYERDRIVER_OPTION (rflex build_rflex ON) PLAYERDRIVER_REJECT_OS (rflex build_rflex PLAYER_OS_WIN) +PLAYERDRIVER_REJECT_OS (reflex build_rflex PLAYER_OS_SOLARIS) PLAYERDRIVER_ADD_DRIVER (rflex build_rflex SOURCES rflex.cc rflex_commands.cc rflex-io.cc) Modified: code/player/trunk/server/drivers/rfid/skyetekM1.cc =================================================================== --- code/player/trunk/server/drivers/rfid/skyetekM1.cc 2009-02-16 01:59:06 UTC (rev 7336) +++ code/player/trunk/server/drivers/rfid/skyetekM1.cc 2009-02-17 00:56:38 UTC (rev 7337) @@ -429,12 +429,25 @@ if (response_buf[0] == 0x02) len = response_buf[1]; - unsigned char TID[len]; - memset (&TID, 0, sizeof (TID)); // clear the struct for new port settings + unsigned char *TID; + if (len <= 0) + { + PLAYER_WARN ("skyetekM1: len <= 0 after serial read"); + return; + } + if ((TID = new unsigned char[len]) == NULL) + { + PLAYER_ERROR ("Failed to allocate memory for TID in skyetekM1 driver."); + return; + } + memset (&TID, 0, len); // clear the struct for new port settings usleep (10000); // sleep for 10ms ReadSerial (TID, len); if (response_buf[2] == 0x94) + { + delete[] TID; break; + } if (response_buf[0] == 0x02) { @@ -455,6 +468,7 @@ this->Data.tags[this->Data.tags_count].guid[j] = TID[j+1]; this->Data.tags_count++; } + delete[] TID; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit