Skip to content

st use function instead of macro #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
remove C++ style comments
  • Loading branch information
funny-falcon committed Jan 3, 2012
commit bd2a4671dfdd8764ea40cd8c46c50e37ba127f68
4 changes: 2 additions & 2 deletions pool_alloc.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ typedef struct pool_holder pool_holder;
typedef struct pool_free_pointer {
pool_entry_list *free;
pool_free_counter count;
pool_holder_counter size; // size of entry in sizeof(void*) items
pool_holder_counter total; // size of entry in sizeof(void*) items
pool_holder_counter size; /* size of entry in sizeof(void*) items */
pool_holder_counter total; /* size of entry in sizeof(void*) items */
} pool_free_pointer;

struct pool_entry_list {
Expand Down
8 changes: 4 additions & 4 deletions st.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ static void rehash(st_table *);

/* remove cast to unsigned int in the future */
#define do_hash(key,table) (unsigned int)(st_index_t)(*(table)->type->hash)((key))
#define PKEY_POS(i, num_bins) ((num_bins)-(i)*2-2) //((num_bins)/3 + (i)*2)
#define PVAL_POS(i, num_bins) ((num_bins)-(i)*2-1) //((num_bins)/3 + (i)*2 + 1)
#define PHASH_POS(i, num_bins) (i) //((num_bins)-(i)*3-1) //(i)
#define PKEY_POS(i, num_bins) ((num_bins)-(i)*2-2)
#define PVAL_POS(i, num_bins) ((num_bins)-(i)*2-1)
#define PHASH_POS(i, num_bins) (i)
#define PKEY(table, i) (st_data_t)(table)->bins[PKEY_POS(i, (table)->num_bins)]
#define PVAL(table, i) (st_data_t)(table)->bins[PVAL_POS(i, (table)->num_bins)]
#define PHASH(table, i) (st_data_t)(table)->bins[PHASH_POS(i, (table)->num_bins)]
#define PKEY_SET(table, i, v) do{ (table)->bins[PKEY_POS(i, (table)->num_bins)] = (st_table_entry *)(v); } while(0)
#define PVAL_SET(table, i, v) do{ (table)->bins[PVAL_POS(i, (table)->num_bins)] = (st_table_entry *)(v); } while(0)
#define PHASH_SET(table, i, v) do{ (table)->bins[PHASH_POS(i, (table)->num_bins)] = (st_table_entry *)(v); } while(0)
//#define ST_PACKED_REFERENCE
/*#define ST_PACKED_REFERENCE*/
#ifdef ST_PACKED_REFERENCE
static inline void
remove_packed_entry(st_table *table, st_index_t i)
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy