axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r638266 - in /webservices/axis2/trunk/c/util/src: file.c linked_list.c
Date Tue, 18 Mar 2008 08:49:52 GMT
Author: pini
Date: Tue Mar 18 01:49:49 2008
New Revision: 638266

URL: http://svn.apache.org/viewvc?rev=638266&view=rev
Log:
Cleaned up the code, added relevant log messages.

Modified:
    webservices/axis2/trunk/c/util/src/file.c
    webservices/axis2/trunk/c/util/src/linked_list.c

Modified: webservices/axis2/trunk/c/util/src/file.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/file.c?rev=638266&r1=638265&r2=638266&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/file.c (original)
+++ webservices/axis2/trunk/c/util/src/file.c Tue Mar 18 01:49:49 2008
@@ -40,6 +40,7 @@
     if (!file)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Not enough memory");
         return NULL;
     }
     file->name = NULL;
@@ -91,6 +92,7 @@
     if (!file->name)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Not enough memory");
         return AXIS2_FAILURE;
     }
     return AXIS2_SUCCESS;
@@ -131,6 +133,7 @@
     if (!(file->path))
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Not enough memory");
         return AXIS2_FAILURE;
     }
     return AXIS2_SUCCESS;

Modified: webservices/axis2/trunk/c/util/src/linked_list.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/linked_list.c?rev=638266&r1=638265&r2=638266&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/linked_list.c (original)
+++ webservices/axis2/trunk/c/util/src/linked_list.c Tue Mar 18 01:49:49 2008
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -55,7 +54,7 @@
 
 AXIS2_EXTERN axutil_linked_list_t *AXIS2_CALL
 axutil_linked_list_create(
-    const axutil_env_t * env)
+    const axutil_env_t *env)
 {
     axutil_linked_list_t *linked_list = NULL;
 
@@ -65,6 +64,7 @@
     if (!linked_list)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Not enough memory");
         return NULL;
     }
 
@@ -78,13 +78,14 @@
 
 static entry_t *
 axutil_linked_list_create_entry(
-    const axutil_env_t * env,
+    const axutil_env_t *env,
     void *data)
 {
     entry_t *entry = (entry_t *) AXIS2_MALLOC(env->allocator, sizeof(entry_t));
     if (!entry)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Not enough memory");
         return NULL;
     }
 
@@ -96,11 +97,10 @@
 
 static axis2_status_t
 axutil_linked_list_add_last_entry(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
     entry_t * e)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, e, AXIS2_FAILURE);
 
     linked_list->mod_count++;
@@ -121,12 +121,11 @@
 
 AXIS2_EXTERN void AXIS2_CALL
 axutil_linked_list_free(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env)
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env)
 {
     entry_t *current = NULL,
-        *next = NULL;
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    *next = NULL;
 
     current = linked_list->first;
     while (current)
@@ -141,8 +140,8 @@
 
 AXIS2_EXTERN entry_t *AXIS2_CALL
 axutil_linked_list_get_entry(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
     int n)
 {
     entry_t *e = NULL;
@@ -171,11 +170,10 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axutil_linked_list_remove_entry(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
-    entry_t * e)
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
+    entry_t *e)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, e, AXIS2_FAILURE);
     linked_list->mod_count++;
     linked_list->size--;
@@ -206,16 +204,14 @@
 
 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
 axutil_linked_list_check_bounds_inclusive(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
     int index)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
-
     if (index < 0 || index > linked_list->size)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INDEX_OUT_OF_BOUNDS,
-                        AXIS2_FAILURE);
+            AXIS2_FAILURE);
         return AXIS2_FALSE;
     }
     return AXIS2_TRUE;
@@ -223,15 +219,14 @@
 
 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
 axutil_linked_list_check_bounds_exclusive(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
     int index)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
     if (index < 0 || index >= linked_list->size)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INDEX_OUT_OF_BOUNDS,
-                        AXIS2_FAILURE);
+            AXIS2_FAILURE);
         return AXIS2_FALSE;
     }
     return AXIS2_TRUE;
@@ -239,8 +234,8 @@
 
 AXIS2_EXTERN void *AXIS2_CALL
 axutil_linked_list_get_first(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env)
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env)
 {
     if (linked_list->size == 0)
     {
@@ -253,11 +248,9 @@
 
 AXIS2_EXTERN void *AXIS2_CALL
 axutil_linked_list_get_last(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env)
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env)
 {
-    AXIS2_ENV_CHECK(env, NULL);
-
     if (linked_list->size == 0)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_SUCH_ELEMENT, AXIS2_FAILURE);
@@ -269,11 +262,10 @@
 
 AXIS2_EXTERN void *AXIS2_CALL
 axutil_linked_list_remove_first(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env)
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env)
 {
     void *r;
-    AXIS2_ENV_CHECK(env, NULL);
 
     if (linked_list->size == 0)
     {
@@ -301,11 +293,10 @@
 
 AXIS2_EXTERN void *AXIS2_CALL
 axutil_linked_list_remove_last(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env)
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env)
 {
     void *r = NULL;
-    AXIS2_ENV_CHECK(env, NULL);
 
     if (linked_list->size == 0)
     {
@@ -333,12 +324,11 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axutil_linked_list_add_first(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
     void *o)
 {
     entry_t *e;
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, o, AXIS2_FAILURE);
 
     e = axutil_linked_list_create_entry(env, o);
@@ -361,12 +351,11 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axutil_linked_list_add_last(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
     void *o)
 {
     entry_t *e;
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, o, AXIS2_FAILURE);
 
     e = axutil_linked_list_create_entry(env, o);
@@ -375,12 +364,11 @@
 
 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
 axutil_linked_list_contains(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
     void *o)
 {
     entry_t *e;
-    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
     AXIS2_PARAM_CHECK(env->error, o, AXIS2_FALSE);
 
     e = linked_list->first;
@@ -395,20 +383,19 @@
 
 AXIS2_EXTERN int AXIS2_CALL
 axutil_linked_list_size(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env)
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env)
 {
     return linked_list->size;
 }
 
 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
 axutil_linked_list_add(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
     void *o)
 {
     entry_t *e;
-    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
     AXIS2_PARAM_CHECK(env->error, o, AXIS2_FALSE);
     e = axutil_linked_list_create_entry(env, o);
     return axutil_linked_list_add_last_entry(linked_list, env, e);
@@ -416,12 +403,11 @@
 
 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
 axutil_linked_list_remove(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
     void *o)
 {
     entry_t *e;
-    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
     AXIS2_PARAM_CHECK(env->error, o, AXIS2_FALSE);
 
     e = linked_list->first;
@@ -438,8 +424,8 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axutil_linked_list_clear(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env)
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env)
 {
     if (linked_list->size > 0)
     {
@@ -454,25 +440,23 @@
 
 AXIS2_EXTERN void *AXIS2_CALL
 axutil_linked_list_get(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
     int index)
 {
-    AXIS2_ENV_CHECK(env, NULL);
     axutil_linked_list_check_bounds_exclusive(linked_list, env, index);
     return axutil_linked_list_get_entry(linked_list, env, index)->data;
 }
 
 AXIS2_EXTERN void *AXIS2_CALL
 axutil_linked_list_set(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
     int index,
     void *o)
 {
     entry_t *e;
     void *old;
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, o, NULL);
     axutil_linked_list_check_bounds_exclusive(linked_list, env, index);
     e = axutil_linked_list_get_entry(linked_list, env, index);
@@ -483,14 +467,13 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axutil_linked_list_add_at_index(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
     int index,
     void *o)
 {
     entry_t *after = NULL;
     entry_t *e;
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, o, AXIS2_FAILURE);
 
     axutil_linked_list_check_bounds_inclusive(linked_list, env, index);
@@ -519,12 +502,11 @@
 
 AXIS2_EXTERN void *AXIS2_CALL
 axutil_linked_list_remove_at_index(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
     int index)
 {
     entry_t *e;
-    AXIS2_ENV_CHECK(env, NULL);
     axutil_linked_list_check_bounds_exclusive(linked_list, env, index);
     e = axutil_linked_list_get_entry(linked_list, env, index);
     axutil_linked_list_remove_entry(linked_list, env, e);
@@ -533,13 +515,12 @@
 
 AXIS2_EXTERN int AXIS2_CALL
 axutil_linked_list_index_of(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
     void *o)
 {
     int index = 0;
     entry_t *e;
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, o, AXIS2_FAILURE);
 
     e = linked_list->first;
@@ -555,13 +536,12 @@
 
 AXIS2_EXTERN int AXIS2_CALL
 axutil_linked_list_last_index_of(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env,
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env,
     void *o)
 {
     int index;
     entry_t *e;
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, o, AXIS2_FAILURE);
 
     index = linked_list->size - 1;
@@ -578,16 +558,14 @@
 
 AXIS2_EXTERN void **AXIS2_CALL
 axutil_linked_list_to_array(
-    axutil_linked_list_t * linked_list,
-    const axutil_env_t * env)
+    axutil_linked_list_t *linked_list,
+    const axutil_env_t *env)
 {
     int i = 0;
     void **array;
     entry_t *e;
-    AXIS2_ENV_CHECK(env, NULL);
-    array =
-        (void **) AXIS2_MALLOC(env->allocator,
-                               linked_list->size * sizeof(void *));
+    array = (void **) AXIS2_MALLOC(env->allocator,
+                linked_list->size * sizeof(void *));
     e = linked_list->first;
     for (i = 0; i < linked_list->size; i++)
     {
@@ -596,3 +574,4 @@
     }
     return array;
 }
+



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message