Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
c-stuff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bruce Cowan
c-stuff
Commits
435671e9
Commit
435671e9
authored
5 years ago
by
Bruce Cowan
Browse files
Options
Downloads
Patches
Plain Diff
Make function pointer typedefs more generic
parent
b64019e4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/types/hashtable.c
+5
-5
5 additions, 5 deletions
lib/types/hashtable.c
lib/types/hashtable.h
+1
-1
1 addition, 1 deletion
lib/types/hashtable.h
lib/types/types.h
+6
-6
6 additions, 6 deletions
lib/types/types.h
with
12 additions
and
12 deletions
lib/types/hashtable.c
+
5
−
5
View file @
435671e9
...
...
@@ -18,7 +18,7 @@ struct _HashTable
SList
**
array
;
HashFunc
hash_func
;
Hash
EqualFunc
equal_func
;
EqualFunc
equal_func
;
FreeFunc
free_key_func
;
FreeFunc
free_value_func
;
};
...
...
@@ -65,10 +65,10 @@ key_value_free (KeyValue *kv,
* Creates a new #HashTable.
*/
HashTable
*
hash_table_new
(
HashFunc
hash_func
,
Hash
EqualFunc
equal_func
,
FreeFunc
free_key_func
,
FreeFunc
free_value_func
)
hash_table_new
(
HashFunc
hash_func
,
EqualFunc
equal_func
,
FreeFunc
free_key_func
,
FreeFunc
free_value_func
)
{
HashTable
*
new
=
check_malloc
(
sizeof
(
HashTable
));
...
...
This diff is collapsed.
Click to expand it.
lib/types/hashtable.h
+
1
−
1
View file @
435671e9
...
...
@@ -7,7 +7,7 @@ typedef struct _HashTable HashTable;
HashTable
*
hash_table_new
(
HashFunc
hash_func
,
Hash
EqualFunc
equal_func
,
EqualFunc
equal_func
,
FreeFunc
free_key_func
,
FreeFunc
free_value_func
);
void
hash_table_free
(
HashTable
*
self
);
...
...
This diff is collapsed.
Click to expand it.
lib/types/types.h
+
6
−
6
View file @
435671e9
...
...
@@ -8,10 +8,10 @@ typedef void (*ForEachFunc) (void *data,
typedef
double
(
*
ValueFunc
)
(
const
void
*
element
);
typedef
int
(
*
CompareFunc
)
(
const
void
*
a
,
const
void
*
b
);
typedef
bool
(
*
EqualFunc
)
(
const
void
*
a
,
const
void
*
b
);
typedef
unsigned
(
*
HashFunc
)
(
const
void
*
key
);
typedef
bool
(
*
HashEqualFunc
)
(
const
void
*
a
,
const
void
*
b
);
typedef
void
(
*
HashIterFunc
)
(
void
*
key
,
void
*
value
,
void
*
user_data
);
typedef
unsigned
(
*
HashFunc
)
(
const
void
*
key
);
typedef
void
(
*
HashIterFunc
)
(
void
*
key
,
void
*
value
,
void
*
user_data
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment