[Opensrf-commits] r1113 - in trunk: include/opensrf src/libopensrf

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Oct 25 08:17:57 EDT 2007


Author: miker
Date: 2007-10-25 08:04:05 -0400 (Thu, 25 Oct 2007)
New Revision: 1113

Modified:
   trunk/include/opensrf/osrf_settings.h
   trunk/src/libopensrf/osrf_settings.c
Log:
Patch from Scott McKellar to clean up some const qualification and initialize a pointer to NULL.



Modified: trunk/include/opensrf/osrf_settings.h
===================================================================
--- trunk/include/opensrf/osrf_settings.h	2007-10-23 15:36:45 UTC (rev 1112)
+++ trunk/include/opensrf/osrf_settings.h	2007-10-25 12:04:05 UTC (rev 1113)
@@ -20,11 +20,11 @@
 } osrf_host_config;
 
 
-osrf_host_config* osrf_settings_new_host_config(char* hostname);
+osrf_host_config* osrf_settings_new_host_config(const char* hostname);
 void osrf_settings_free_host_config(osrf_host_config*);
-char* osrf_settings_host_value(char* path, ...);
-jsonObject* osrf_settings_host_value_object(char* format, ...);
-int osrf_settings_retrieve(char* hostname);
+char* osrf_settings_host_value(const char* path, ...);
+jsonObject* osrf_settings_host_value_object(const char* format, ...);
+int osrf_settings_retrieve(const char* hostname);
 
 #endif
 

Modified: trunk/src/libopensrf/osrf_settings.c
===================================================================
--- trunk/src/libopensrf/osrf_settings.c	2007-10-23 15:36:45 UTC (rev 1112)
+++ trunk/src/libopensrf/osrf_settings.c	2007-10-25 12:04:05 UTC (rev 1113)
@@ -2,7 +2,7 @@
 
 osrf_host_config* config = NULL;
 
-char* osrf_settings_host_value(char* format, ...) {
+char* osrf_settings_host_value(const char* format, ...) {
 	VA_LIST_TO_STRING(format);
 
 	if( ! config ) {
@@ -18,7 +18,7 @@
 	return val;
 }
 
-jsonObject* osrf_settings_host_value_object(char* format, ...) {
+jsonObject* osrf_settings_host_value_object(const char* format, ...) {
 	VA_LIST_TO_STRING(format);
 
 	if( ! config ) {
@@ -32,7 +32,7 @@
 }
 
 
-int osrf_settings_retrieve(char* hostname) {
+int osrf_settings_retrieve(const char* hostname) {
 
 	if(!config) {
 
@@ -72,10 +72,11 @@
 	return 0;
 }
 
-osrf_host_config* osrf_settings_new_host_config(char* hostname) {
+osrf_host_config* osrf_settings_new_host_config(const char* hostname) {
 	if(!hostname) return NULL;
 	osrf_host_config* c = safe_malloc(sizeof(osrf_host_config));
 	c->hostname = strdup(hostname);
+	c->config = NULL;
 	return c;
 }
 



More information about the opensrf-commits mailing list