Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
1c884ec7
Commit
1c884ec7
authored
Jun 22, 2015
by
Simon Ninon
Browse files
Use explicit casts for void* pointer in order to compile in C++
parent
f58dd249
Changes
1
Hide whitespace changes
Inline
Side-by-side
adapters/glib.h
View file @
1c884ec7
...
@@ -16,43 +16,43 @@ typedef struct
...
@@ -16,43 +16,43 @@ typedef struct
static
void
static
void
redis_source_add_read
(
gpointer
data
)
redis_source_add_read
(
gpointer
data
)
{
{
RedisSource
*
source
=
data
;
RedisSource
*
source
=
(
RedisSource
*
)
data
;
g_return_if_fail
(
source
);
g_return_if_fail
(
source
);
source
->
poll_fd
.
events
|=
G_IO_IN
;
source
->
poll_fd
.
events
|=
G_IO_IN
;
g_main_context_wakeup
(
g_source_get_context
(
data
));
g_main_context_wakeup
(
g_source_get_context
(
(
GSource
*
)
data
));
}
}
static
void
static
void
redis_source_del_read
(
gpointer
data
)
redis_source_del_read
(
gpointer
data
)
{
{
RedisSource
*
source
=
data
;
RedisSource
*
source
=
(
RedisSource
*
)
data
;
g_return_if_fail
(
source
);
g_return_if_fail
(
source
);
source
->
poll_fd
.
events
&=
~
G_IO_IN
;
source
->
poll_fd
.
events
&=
~
G_IO_IN
;
g_main_context_wakeup
(
g_source_get_context
(
data
));
g_main_context_wakeup
(
g_source_get_context
(
(
GSource
*
)
data
));
}
}
static
void
static
void
redis_source_add_write
(
gpointer
data
)
redis_source_add_write
(
gpointer
data
)
{
{
RedisSource
*
source
=
data
;
RedisSource
*
source
=
(
RedisSource
*
)
data
;
g_return_if_fail
(
source
);
g_return_if_fail
(
source
);
source
->
poll_fd
.
events
|=
G_IO_OUT
;
source
->
poll_fd
.
events
|=
G_IO_OUT
;
g_main_context_wakeup
(
g_source_get_context
(
data
));
g_main_context_wakeup
(
g_source_get_context
(
(
GSource
*
)
data
));
}
}
static
void
static
void
redis_source_del_write
(
gpointer
data
)
redis_source_del_write
(
gpointer
data
)
{
{
RedisSource
*
source
=
data
;
RedisSource
*
source
=
(
RedisSource
*
)
data
;
g_return_if_fail
(
source
);
g_return_if_fail
(
source
);
source
->
poll_fd
.
events
&=
~
G_IO_OUT
;
source
->
poll_fd
.
events
&=
~
G_IO_OUT
;
g_main_context_wakeup
(
g_source_get_context
(
data
));
g_main_context_wakeup
(
g_source_get_context
(
(
GSource
*
)
data
));
}
}
static
void
static
void
redis_source_cleanup
(
gpointer
data
)
redis_source_cleanup
(
gpointer
data
)
{
{
RedisSource
*
source
=
data
;
RedisSource
*
source
=
(
RedisSource
*
)
data
;
g_return_if_fail
(
source
);
g_return_if_fail
(
source
);
...
@@ -63,7 +63,7 @@ redis_source_cleanup (gpointer data)
...
@@ -63,7 +63,7 @@ redis_source_cleanup (gpointer data)
* current main loop. However, we will remove the GPollFD.
* current main loop. However, we will remove the GPollFD.
*/
*/
if
(
source
->
poll_fd
.
fd
>=
0
)
{
if
(
source
->
poll_fd
.
fd
>=
0
)
{
g_source_remove_poll
(
data
,
&
source
->
poll_fd
);
g_source_remove_poll
(
(
GSource
*
)
data
,
&
source
->
poll_fd
);
source
->
poll_fd
.
fd
=
-
1
;
source
->
poll_fd
.
fd
=
-
1
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment