util: Move u_debug to utils
[mesa.git] / src / gallium / auxiliary / util / u_handle_table.c
index 3703718a621d0a6ae1a90386c11a74c0bafbbe77..c6eeeef0f3a9f5a2a01e3588ce8c72896b2567ae 100644 (file)
@@ -1,6 +1,6 @@
 /**************************************************************************
  *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2008 VMware, Inc.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -18,7 +18,7 @@
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -29,7 +29,7 @@
  * @file
  * Generic handle table implementation.
  *  
- * @author José Fonseca <jrfonseca@tungstengraphics.com>
+ * @author José Fonseca <jfonseca@vmware.com>
  */
 
 
@@ -64,7 +64,7 @@ handle_table_create(void)
    struct handle_table *ht;
    
    ht = MALLOC_STRUCT(handle_table);
-   if(!ht)
+   if (!ht)
       return NULL;
    
    ht->objects = (void **)CALLOC(HANDLE_TABLE_INITIAL_SIZE, sizeof(void *));
@@ -96,7 +96,7 @@ handle_table_set_destroy(struct handle_table *ht,
 /**
  * Resize the table if necessary 
  */
-static INLINE int
+static inline int
 handle_table_resize(struct handle_table *ht,
                     unsigned minimum_size)
 {
@@ -114,7 +114,7 @@ handle_table_resize(struct handle_table *ht,
    new_objects = (void **)REALLOC((void *)ht->objects,
                                  ht->size*sizeof(void *),
                                  new_size*sizeof(void *));
-   if(!new_objects)
+   if (!new_objects)
       return 0;
    
    memset(new_objects + ht->size, 0, (new_size - ht->size)*sizeof(void *));
@@ -126,7 +126,7 @@ handle_table_resize(struct handle_table *ht,
 }
 
 
-static INLINE void
+static inline void
 handle_table_clear(struct handle_table *ht, 
                    unsigned index)
 {
@@ -139,7 +139,7 @@ handle_table_clear(struct handle_table *ht,
     */
 
    object = ht->objects[index];
-   if(object) {
+   if (object) {
       ht->objects[index] = NULL;
       
       if(ht->destroy)
@@ -199,7 +199,7 @@ handle_table_set(struct handle_table *ht,
       return 0;
 
    assert(object);
-   if(!object)
+   if (!object)
       return 0;
    
    index = handle - 1;
@@ -247,7 +247,7 @@ handle_table_remove(struct handle_table *ht,
 
    index = handle - 1;
    object = ht->objects[index];
-   if(!object)
+   if (!object)
       return;
    
    handle_table_clear(ht, index);