You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2015/11/26 19:36:18 UTC

celix git commit: CELIX-242: Fix for several clang warning. Also enables -Werror for clang

Repository: celix
Updated Branches:
  refs/heads/develop 5e04c3d6a -> d7d396a54


CELIX-242: Fix for several clang warning. Also enables -Werror for clang


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/d7d396a5
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/d7d396a5
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/d7d396a5

Branch: refs/heads/develop
Commit: d7d396a5401905959b71dd226ed4e38ead4fb35c
Parents: 5e04c3d
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Thu Nov 26 19:36:30 2015 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Thu Nov 26 19:36:30 2015 +0100

----------------------------------------------------------------------
 CMakeLists.txt                                                 | 5 +----
 device_access/driver_locator/private/src/driver_locator.c      | 4 +---
 framework/private/src/bundle_archive.c                         | 6 +++---
 framework/private/src/manifest.c                               | 5 -----
 .../dynamic_function_interface/memstream/fmemopen.c            | 5 ++---
 .../rsa/private/include/remote_service_admin_dfi.h             | 2 +-
 6 files changed, 8 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/d7d396a5/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c7497b..014621c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,10 +35,7 @@ IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} EQUAL 3.3 AND ${CMAKE_GENERATO
 ENDIF()
 
 IF(UNIX)
-	SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -Wall ${CMAKE_C_FLAGS}")
-ENDIF()
-IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") 
-    SET(CMAKE_C_FLAGS "-Werror ${CMAKE_C_FLAGS}")
+    SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -Wall -Werror ${CMAKE_C_FLAGS}")
 ENDIF()
 IF(UNIX AND NOT APPLE) 
 	SET(CMAKE_C_FLAGS "-pthread ${CMAKE_C_FLAGS}")

http://git-wip-us.apache.org/repos/asf/celix/blob/d7d396a5/device_access/driver_locator/private/src/driver_locator.c
----------------------------------------------------------------------
diff --git a/device_access/driver_locator/private/src/driver_locator.c b/device_access/driver_locator/private/src/driver_locator.c
index 50bd2f2..8ccd6de 100644
--- a/device_access/driver_locator/private/src/driver_locator.c
+++ b/device_access/driver_locator/private/src/driver_locator.c
@@ -52,9 +52,7 @@ celix_status_t driverLocator_findDrivers(driver_locator_pt locator, properties_p
 					int length = strlen(str1) + strlen(str2) + 2;
 					char driver[length];
 					snprintf(driver, length, "%s_%s", str1, str2);
-					if (driver != NULL) {
-						arrayList_add(*drivers, strdup(driver));
-					}
+                    arrayList_add(*drivers, strdup(driver));
 				}
 			}
 			closedir(dir);

http://git-wip-us.apache.org/repos/asf/celix/blob/d7d396a5/framework/private/src/bundle_archive.c
----------------------------------------------------------------------
diff --git a/framework/private/src/bundle_archive.c b/framework/private/src/bundle_archive.c
index 6df7270..c229697 100644
--- a/framework/private/src/bundle_archive.c
+++ b/framework/private/src/bundle_archive.c
@@ -326,11 +326,11 @@ celix_status_t bundleArchive_getPersistentState(bundle_archive_pt archive, bundl
         }
 
         if (status == CELIX_SUCCESS) {
-            if (stateString != NULL && (strcmp(stateString, "active") == 0)) {
+            if (strncmp(stateString, "active", 256) == 0) {
                 archive->persistentState = OSGI_FRAMEWORK_BUNDLE_ACTIVE;
-            } else if (stateString != NULL && (strcmp(stateString, "starting") == 0)) {
+            } else if (strncmp(stateString, "starting", 256) == 0) {
                 archive->persistentState = OSGI_FRAMEWORK_BUNDLE_STARTING;
-            } else if (stateString != NULL && (strcmp(stateString, "uninstalled") == 0)) {
+            } else if (strncmp(stateString, "uninstalled", 256) == 0) {
                 archive->persistentState = OSGI_FRAMEWORK_BUNDLE_UNINSTALLED;
             } else {
                 archive->persistentState = OSGI_FRAMEWORK_BUNDLE_INSTALLED;

http://git-wip-us.apache.org/repos/asf/celix/blob/d7d396a5/framework/private/src/manifest.c
----------------------------------------------------------------------
diff --git a/framework/private/src/manifest.c b/framework/private/src/manifest.c
index 7c57e27..b84cb26 100644
--- a/framework/private/src/manifest.c
+++ b/framework/private/src/manifest.c
@@ -223,11 +223,6 @@ celix_status_t manifest_readAttributes(manifest_pt manifest, properties_pt prope
 			buf[0] = '\0';
 
 			// Line continued
-			if (name == NULL) {
-			    buf[0] = '\0';
-				printf("MANIFEST: No continued line expected\n");
-				return CELIX_FILE_IO_EXCEPTION;
-			}
 			lineContinued = true;
 			strcat(buf, lastLine);
 			strncat(buf, lbuf+1, len - 1);

http://git-wip-us.apache.org/repos/asf/celix/blob/d7d396a5/remote_services/remote_service_admin_dfi/dynamic_function_interface/memstream/fmemopen.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/memstream/fmemopen.c b/remote_services/remote_service_admin_dfi/dynamic_function_interface/memstream/fmemopen.c
index 4c18650..66fc9c5 100644
--- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/memstream/fmemopen.c
+++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/memstream/fmemopen.c
@@ -4,7 +4,6 @@
  * 20081017 AF
  */
 
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -55,7 +54,7 @@ static fpos_t seekfn(void *handler, fpos_t offset, int whence)
         default: return -1;
     }
 
-    if(pos < 0 || pos > mem->size) return -1;
+    if(pos > mem->size) return -1;
 
     mem->pos = pos;
     return (fpos_t) pos;
@@ -76,4 +75,4 @@ FILE *fmemopen(void *buf, size_t size, const char *mode)
     mem->size = size, mem->buffer = buf;
     return funopen(mem, readfn, writefn, seekfn, closefn);
 }
-#endif
\ No newline at end of file
+#endif

http://git-wip-us.apache.org/repos/asf/celix/blob/d7d396a5/remote_services/remote_service_admin_dfi/rsa/private/include/remote_service_admin_dfi.h
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa/private/include/remote_service_admin_dfi.h b/remote_services/remote_service_admin_dfi/rsa/private/include/remote_service_admin_dfi.h
index b820b79..8b282f1 100644
--- a/remote_services/remote_service_admin_dfi/rsa/private/include/remote_service_admin_dfi.h
+++ b/remote_services/remote_service_admin_dfi/rsa/private/include/remote_service_admin_dfi.h
@@ -31,7 +31,7 @@
 #include "bundle_context.h"
 #include "endpoint_description.h"
 
-typedef struct remote_service_admin *remote_service_admin_pt;
+//typedef struct remote_service_admin *remote_service_admin_pt;
 
 celix_status_t remoteServiceAdmin_create(bundle_context_pt context, remote_service_admin_pt *admin);
 celix_status_t remoteServiceAdmin_destroy(remote_service_admin_pt *admin);