/**************************************************************************
*
- * 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
* 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.
* @file
* Generic handle table implementation.
*
- * @author José Fonseca <jrfonseca@tungstengraphics.com>
+ * @author José Fonseca <jfonseca@vmware.com>
*/
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 *));
/**
* Resize the table if necessary
*/
-static INLINE int
+static inline int
handle_table_resize(struct handle_table *ht,
unsigned minimum_size)
{
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 *));
}
-static INLINE void
+static inline void
handle_table_clear(struct handle_table *ht,
unsigned index)
{
*/
object = ht->objects[index];
- if(object) {
+ if (object) {
ht->objects[index] = NULL;
if(ht->destroy)
return 0;
assert(object);
- if(!object)
+ if (!object)
return 0;
index = handle - 1;
index = handle - 1;
object = ht->objects[index];
- if(!object)
+ if (!object)
return;
handle_table_clear(ht, index);