From: Danny B. <dan...@us...> - 2010-08-20 18:27:41
|
Update of /cvsroot/roadmap/roadmap/src/android In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv1210/d Modified Files: Makefile roadmap_androidgps.c roadmap_androidgps.h roadmap_main.c Log Message: Clean up some compiler warnings. Fix an issue with remove_periodic, RoadMap didn't work after being restarted because the same handler was entered again, and its pointer was still in the table. Add an exception handler for the shared library load. Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 14 Aug 2010 06:22:54 -0000 1.1 --- Makefile 20 Aug 2010 18:27:33 -0000 1.2 *************** *** 57,65 **** # I used this with Android 2.1 # - #NDKHOME= /home/danny/src/android/android-ndk-r3 - #SDKPLAT= ${SDKHOME}/platforms/android-7 - #NDK_CFLAGS= -I$(NDKHOME)/build/platforms/android-5/arch-arm/usr/include \ - # -I$(NDK)/apps/ndk_demo/project/jni \ - # -DANDROID -fno-short-enums -g NDKHOME= /home/danny/src/android/android-ndk-r4 --- 57,60 ---- *************** *** 67,74 **** SDKPLAT= ${SDKHOME}/platforms/android-8 NDK_CFLAGS= -I$(NDKHOME)/build/platforms/android-5/arch-arm/usr/include \ - -I$(NDK)/apps/ndk_demo/project/jni \ -DANDROID -fno-short-enums -g NDK_LDFLAGS= -nostdlib -Wl,-shared,-Bsymbolic -Wl,--no-undefined -Wl,-z,noexecstack - #JAVAC_FLAGS= -cp ${SDKPLAT}/android.jar -sourcepath gen:src JAVA= /usr/share/java JAVAC_FLAGS= -cp ${JAVA}/jaxp_parser_impl.jar:${JAVA}/xml-commons-apis.jar:${JAVA}/antlr.jar:${JAVA}/ant/ant-antlr.jar:${JAVA}/regexp.jar:${JAVA}/ant/ant-apache-regexp.jar:${JAVA}/jakarta-commons-logging.jar:${JAVA}/ant/ant-commons-logging.jar:${JAVA}/javamail.jar:${JAVA}/jaf.jar:${JAVA}/ant/ant-javamail.jar:${JAVA}/jsch.jar:${JAVA}/ant/ant-jsch.jar:/usr/lib/jvm/java/lib/tools.jar:${SDKPLAT}/android.jar -sourcepath gen:src -bootclasspath ${SDKPLAT}/android.jar --- 62,67 ---- Index: roadmap_androidgps.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/roadmap_androidgps.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_androidgps.c 14 Aug 2010 06:22:54 -0000 1.1 --- roadmap_androidgps.c 20 Aug 2010 18:27:33 -0000 1.2 *************** *** 42,48 **** * These functions need to be called when Android has info from the GPS. */ ! static RoadMapGpsdNavigation RoadmapGpsd2NavigationListener = NULL; ! static RoadMapGpsdSatellite RoadmapGpsd2SatelliteListener = NULL; ! static RoadMapGpsdDilution RoadmapGpsd2DilutionListener = NULL; /** --- 42,48 ---- * These functions need to be called when Android has info from the GPS. */ ! static RoadMapGpsdNavigation navigationListener = NULL; ! static RoadMapGpsdSatellite satelliteListener = NULL; ! static RoadMapGpsdDilution dilutionListener = NULL; /** *************** *** 55,59 **** void roadmap_androidgps_subscribe_to_navigation (RoadMapGpsdNavigation navigation) { ! RoadmapGpsd2NavigationListener = navigation; } --- 55,59 ---- void roadmap_androidgps_subscribe_to_navigation (RoadMapGpsdNavigation navigation) { ! navigationListener = navigation; } *************** *** 61,65 **** void roadmap_androidgps_subscribe_to_satellites (RoadMapGpsdSatellite satellite) { ! RoadmapGpsd2SatelliteListener = satellite; } --- 61,65 ---- void roadmap_androidgps_subscribe_to_satellites (RoadMapGpsdSatellite satellite) { ! satelliteListener = satellite; } *************** *** 67,71 **** void roadmap_androidgps_subscribe_to_dilution (RoadMapGpsdDilution dilution) { ! RoadmapGpsd2DilutionListener = dilution; } --- 67,71 ---- void roadmap_androidgps_subscribe_to_dilution (RoadMapGpsdDilution dilution) { ! dilutionListener = dilution; } *************** *** 80,92 **** int status, int gpstime, int lat, int lon, int alt, int speed, int steering) { ! if (! RoadmapGpsd2NavigationListener) { // FIX ME should be an exception ? __android_log_print (ANDROID_LOG_ERROR, "RoadMap", "No listener"); return; } ! roadmap_log (ROADMAP_DEBUG, ! "HereAmI(st %d, gps %d %d, spd %d, tm %d)", ! status, lat, lon, speed, gpstime); ! RoadmapGpsd2NavigationListener(status, gpstime, lat, lon, alt, speed, steering); } --- 80,92 ---- int status, int gpstime, int lat, int lon, int alt, int speed, int steering) { ! if (! navigationListener) { // FIX ME should be an exception ? __android_log_print (ANDROID_LOG_ERROR, "RoadMap", "No listener"); return; } ! ! // roadmap_log (ROADMAP_DEBUG, "HereAmI(st %d, gps %d %d, spd %d, tm %d)", status, lat, lon, speed, gpstime); ! ! navigationListener(status, gpstime, lat, lon, alt, speed, steering); } *************** *** 131,135 **** // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "Satellite(%d,%d,%d,%d,%d,%d", sequence, id, elevation, azimuth, strength, active); ! RoadmapGpsd2SatelliteListener(sequence, id, elevation, azimuth, strength, active); } --- 131,135 ---- // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "Satellite(%d,%d,%d,%d,%d,%d", sequence, id, elevation, azimuth, strength, active); ! satelliteListener(sequence, id, elevation, azimuth, strength, active); } Index: roadmap_androidgps.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/roadmap_androidgps.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_androidgps.h 14 Aug 2010 06:22:54 -0000 1.1 --- roadmap_androidgps.h 20 Aug 2010 18:27:33 -0000 1.2 *************** *** 45,48 **** --- 45,49 ---- void roadmap_androidgps_periodic (void); + void roadmap_androidgps_close (void); #endif // INCLUDE__ROADMAP_ANDROIDGPS__H Index: roadmap_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/roadmap_main.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_main.c 14 Aug 2010 06:22:54 -0000 1.1 --- roadmap_main.c 20 Aug 2010 18:27:33 -0000 1.2 *************** *** 39,42 **** --- 39,43 ---- #include "roadmap_config.h" #include "roadmap_history.h" + #include "roadmap_canvas.h" #include "roadmap_main.h" *************** *** 251,255 **** jmethodID mid; jstring jslabel, jsicon, jstip; - char *fnicon; if ((label == 0 || strlen(label) == 0) && (icon == 0 || strlen(icon) == 0)) --- 252,255 ---- *************** *** 266,270 **** * The Java code doesn't handle this because we do it here. */ ! fnicon = roadmap_path_search_icon(icon); jsicon = fnicon ? (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, fnicon) : NULL; --- 266,270 ---- * The Java code doesn't handle this because we do it here. */ ! const char *fnicon = roadmap_path_search_icon(icon); jsicon = fnicon ? (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, fnicon) : NULL; *************** *** 340,344 **** RoadMapMainIo[i].io = *io; RoadMapMainIo[i].callback = callback; ! RoadMapMainIo[i].id = NULL; break; } --- 340,344 ---- RoadMapMainIo[i].io = *io; RoadMapMainIo[i].callback = callback; ! RoadMapMainIo[i].id = 0; break; } *************** *** 376,379 **** --- 376,382 ---- for (index = 0; index < ROADMAP_MAX_TIMER; ++index) { if (RoadMapMainPeriodicTimer[index].callback == callback) { + /* this should not happen */ + roadmap_log(ROADMAP_ERROR, "roadmap_main_set_periodic - duplicate %d %p", + interval, callback); return; } *************** *** 424,427 **** --- 427,432 ---- (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, RoadMapThiz, mid, index); + + RoadMapMainPeriodicTimer[index].callback = NULL; } } |