Index: uspace/srv/net/structures/int_map.h
===================================================================
--- uspace/srv/net/structures/int_map.h	(revision ede63e47763744e7b1eba0111fb300543d072dc9)
+++ uspace/srv/net/structures/int_map.h	(revision aadf01ebd2c032bc8dd43a6e06ae5715e6c2710f)
@@ -55,5 +55,5 @@
  *  @param[in] type Inner object type.
  */
-#define INT_MAP_DECLARE( name, type )											\
+#define INT_MAP_DECLARE(name, type)												\
 																				\
 typedef	struct name			name##_t;											\
@@ -63,29 +63,29 @@
 																				\
 struct	name##_item{															\
-	int		key;																\
-	type *	value;																\
-	int		magic;																\
+	int key;																\
+	type * value;																\
+	int magic;																\
 };																				\
 																				\
 struct	name{																	\
-	int				size;														\
-	int				next;														\
-	name##_item_ref	items;														\
-	int				magic;														\
+	int size;														\
+	int next;														\
+	name##_item_ref items;														\
+	int magic;														\
 };																				\
 																				\
-int		name##_add( name##_ref map, int key, type * value );					\
-void	name##_clear( name##_ref map );											\
-int		name##_count( name##_ref map );											\
-void	name##_destroy( name##_ref map );										\
-void	name##_exclude( name##_ref map, int key );								\
-void	name##_exclude_index( name##_ref map, int index );						\
-type *	name##_find( name##_ref map, int key );									\
-int		name##_update( name##_ref map, int key, int new_key );					\
-type *	name##_get_index( name##_ref map, int index );							\
-int		name##_initialize( name##_ref map );									\
-int		name##_is_valid( name##_ref map );										\
-void	name##_item_destroy( name##_item_ref item );							\
-int		name##_item_is_valid( name##_item_ref item );
+int name##_add(name##_ref map, int key, type * value);							\
+void name##_clear(name##_ref map);												\
+int name##_count(name##_ref map);												\
+void name##_destroy(name##_ref map);											\
+void name##_exclude(name##_ref map, int key);									\
+void name##_exclude_index(name##_ref map, int index);							\
+type * name##_find(name##_ref map, int key);									\
+int name##_update(name##_ref map, int key, int new_key);						\
+type * name##_get_index(name##_ref map, int index);								\
+int name##_initialize(name##_ref map);											\
+int name##_is_valid(name##_ref map);											\
+void name##_item_destroy(name##_item_ref item);									\
+int name##_item_is_valid(name##_item_ref item);
 
 /** Integer to generic type map implementation.
@@ -94,21 +94,23 @@
  *  @param[in] type Inner object type.
  */
-#define INT_MAP_IMPLEMENT( name, type )											\
-																				\
-int name##_add( name##_ref map, int key, type * value ){						\
-	if( name##_is_valid( map )){												\
-		if( map->next == ( map->size - 1 )){									\
-			name##_item_ref	tmp;												\
-																				\
-			tmp = ( name##_item_ref ) realloc( map->items, sizeof( name##_item_t ) * 2 * map->size );	\
-			if( ! tmp ) return ENOMEM;											\
+#define INT_MAP_IMPLEMENT(name, type)											\
+																				\
+int name##_add(name##_ref map, int key, type * value){							\
+	if(name##_is_valid(map)){													\
+		if(map->next == (map->size - 1)){										\
+			name##_item_ref tmp;												\
+																				\
+			tmp = (name##_item_ref) realloc(map->items, sizeof(name##_item_t) * 2 * map->size);	\
+			if(! tmp){															\
+				return ENOMEM;													\
+			}																	\
 			map->size *= 2;														\
 			map->items = tmp;													\
 		}																		\
-		map->items[ map->next ].key = key;										\
-		map->items[ map->next ].value = value;									\
-		map->items[ map->next ].magic = INT_MAP_ITEM_MAGIC_VALUE;				\
+		map->items[map->next].key = key;										\
+		map->items[map->next].value = value;									\
+		map->items[map->next].magic = INT_MAP_ITEM_MAGIC_VALUE;					\
 		++ map->next;															\
-		map->items[ map->next ].magic = 0;										\
+		map->items[map->next].magic = 0;										\
 		return map->next - 1;													\
 	}																			\
@@ -116,63 +118,63 @@
 }																				\
 																				\
-void name##_clear( name##_ref map ){											\
-	if( name##_is_valid( map )){												\
-		int	index;																\
+void name##_clear(name##_ref map){												\
+	if(name##_is_valid(map)){													\
+		int index;																\
 																				\
 /*		map->magic = 0;*/														\
-		for( index = 0; index < map->next; ++ index ){							\
-			if( name##_item_is_valid( &( map->items[ index ] ))){				\
-				name##_item_destroy( &( map->items[ index ] ));					\
+		for(index = 0; index < map->next; ++ index){							\
+			if(name##_item_is_valid(&(map->items[index]))){						\
+				name##_item_destroy(&(map->items[index]));						\
 			}																	\
 		}																		\
 		map->next = 0;															\
-		map->items[ map->next ].magic = 0;										\
+		map->items[map->next].magic = 0;										\
 /*		map->magic = INT_MAP_MAGIC_VALUE;*/										\
 	}																			\
 }																				\
 																				\
-int name##_count( name##_ref map ){												\
-	return name##_is_valid( map ) ? map->next : -1;								\
-}																				\
-																				\
-void name##_destroy( name##_ref map ){											\
-	if( name##_is_valid( map )){												\
-		int	index;																\
+int name##_count(name##_ref map){												\
+	return name##_is_valid(map) ? map->next : -1;								\
+}																				\
+																				\
+void name##_destroy(name##_ref map){											\
+	if(name##_is_valid(map)){													\
+		int index;																\
 																				\
 		map->magic = 0;															\
-		for( index = 0; index < map->next; ++ index ){							\
-			if( name##_item_is_valid( &( map->items[ index ] ))){				\
-				name##_item_destroy( &( map->items[ index ] ));					\
-			}																	\
-		}																		\
-		free( map->items );														\
-	}																			\
-}																				\
-																				\
-void name##_exclude( name##_ref map, int key ){									\
-	if( name##_is_valid( map )){												\
-		int	index;																\
-																				\
-		for( index = 0; index < map->next; ++ index ){							\
-			if( name##_item_is_valid( &( map->items[ index ] )) && ( map->items[ index ].key == key )){	\
-				name##_item_destroy( &( map->items[ index ] ));					\
-			}																	\
-		}																		\
-	}																			\
-}																				\
-																				\
-void name##_exclude_index( name##_ref map, int index ){							\
-	if( name##_is_valid( map ) && ( index >= 0 ) && ( index < map->next ) && name##_item_is_valid( &( map->items[ index ] ))){	\
-		name##_item_destroy( &( map->items[ index ] ));							\
-	}																			\
-}																				\
-																				\
-type * name##_find( name##_ref map, int key ){									\
-	if( name##_is_valid( map )){												\
-		int	index;																\
-																				\
-		for( index = 0; index < map->next; ++ index ){							\
-			if( name##_item_is_valid( &( map->items[ index ] )) && ( map->items[ index ].key == key )){	\
-				return map->items[ index ].value;								\
+		for(index = 0; index < map->next; ++ index){							\
+			if(name##_item_is_valid(&(map->items[index]))){						\
+				name##_item_destroy(&(map->items[index]));						\
+			}																	\
+		}																		\
+		free(map->items);														\
+	}																			\
+}																				\
+																				\
+void name##_exclude(name##_ref map, int key){									\
+	if(name##_is_valid(map)){													\
+		int index;																\
+																				\
+		for(index = 0; index < map->next; ++ index){							\
+			if(name##_item_is_valid(&(map->items[index])) && (map->items[index].key == key)){	\
+				name##_item_destroy(&(map->items[index]));						\
+			}																	\
+		}																		\
+	}																			\
+}																				\
+																				\
+void name##_exclude_index(name##_ref map, int index){							\
+	if(name##_is_valid(map) && (index >= 0) && (index < map->next) && name##_item_is_valid(&(map->items[index]))){	\
+		name##_item_destroy(&(map->items[index]));								\
+	}																			\
+}																				\
+																				\
+type * name##_find(name##_ref map, int key){									\
+	if(name##_is_valid(map)){													\
+		int index;																\
+																				\
+		for(index = 0; index < map->next; ++ index){							\
+			if(name##_item_is_valid(&(map->items[index])) && (map->items[index].key == key)){	\
+				return map->items[index].value;									\
 			}																	\
 		}																		\
@@ -181,14 +183,14 @@
 }																				\
 																				\
-int name##_update( name##_ref map, int key, int new_key ){						\
-	if( name##_is_valid( map )){												\
-		int	index;																\
-																				\
-		for( index = 0; index < map->next; ++ index ){							\
-			if( name##_item_is_valid( &( map->items[ index ] ))){				\
-				if( map->items[ index ].key == new_key ){						\
+int name##_update(name##_ref map, int key, int new_key){						\
+	if(name##_is_valid(map)){													\
+		int index;																\
+																				\
+		for(index = 0; index < map->next; ++ index){							\
+			if(name##_item_is_valid(&(map->items[index]))){						\
+				if(map->items[index].key == new_key){							\
 					return EEXIST;												\
-				}else if( map->items[ index ].key == key ){						\
-					map->items[ index ].key = new_key;							\
+				}else if(map->items[index].key == key){							\
+					map->items[index].key = new_key;							\
 					return EOK;													\
 				}																\
@@ -199,31 +201,35 @@
 }																				\
 																				\
-type * name##_get_index( name##_ref map, int index ){							\
-	if( name##_is_valid( map ) && ( index >= 0 ) && ( index < map->next ) && name##_item_is_valid( &( map->items[ index ] ))){	\
-		return map->items[ index ].value;										\
+type * name##_get_index(name##_ref map, int index){								\
+	if(name##_is_valid(map) && (index >= 0) && (index < map->next) && name##_item_is_valid(&(map->items[index]))){	\
+		return map->items[index].value;											\
 	}																			\
 	return NULL;																\
 }																				\
 																				\
-int name##_initialize( name##_ref map ){										\
-	if( ! map ) return EINVAL;													\
+int name##_initialize(name##_ref map){											\
+	if(! map){																	\
+		return EINVAL;															\
+	}																			\
 	map->size = 2;																\
 	map->next = 0;																\
-	map->items = ( name##_item_ref ) malloc( sizeof( name##_item_t ) * map->size );	\
-	if( ! map->items ) return ENOMEM;											\
-	map->items[ map->next ].magic = 0;											\
+	map->items = (name##_item_ref) malloc(sizeof(name##_item_t) * map->size);	\
+	if(! map->items){															\
+		return ENOMEM;															\
+	}																			\
+	map->items[map->next].magic = 0;											\
 	map->magic = INT_MAP_MAGIC_VALUE;											\
 	return EOK;																	\
 }																				\
 																				\
-int name##_is_valid( name##_ref map ){											\
-	return map && ( map->magic == INT_MAP_MAGIC_VALUE );						\
-}																				\
-																				\
-void name##_item_destroy( name##_item_ref item ){								\
-	if( name##_item_is_valid( item )){											\
+int name##_is_valid(name##_ref map){											\
+	return map && (map->magic == INT_MAP_MAGIC_VALUE);							\
+}																				\
+																				\
+void name##_item_destroy(name##_item_ref item){									\
+	if(name##_item_is_valid(item)){												\
 		item->magic = 0;														\
-		if( item->value ){														\
-			free( item->value );												\
+		if(item->value){														\
+			free(item->value);													\
 			item->value = NULL;													\
 		}																		\
@@ -231,6 +237,6 @@
 }																				\
 																				\
-int name##_item_is_valid( name##_item_ref item ){								\
-	return item && ( item->magic == INT_MAP_ITEM_MAGIC_VALUE );					\
+int name##_item_is_valid(name##_item_ref item){									\
+	return item && (item->magic == INT_MAP_ITEM_MAGIC_VALUE);					\
 }
 
