1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2026-03-02 04:09:18 +00:00

chore(WF_CONTAINER_OF): makes WF_CONTAINER_OF use typeof, if available (#26)

* makes WF_CONTAINER_OF use typeof, if available

* convertss WF_CONTAINER_OF to lower case

* fixes include guard
This commit is contained in:
Falk Werner
2019-04-25 20:08:34 +02:00
committed by GitHub
parent f4180224b2
commit a717248e80
6 changed files with 19 additions and 11 deletions

View File

@@ -69,7 +69,7 @@ static void wf_impl_session_dispose_filesystems(
while (NULL != item)
{
struct wf_slist_item * next = item->next;
struct wf_impl_filesystem * filesystem = WF_CONTAINER_OF(item, struct wf_impl_filesystem, item);
struct wf_impl_filesystem * filesystem = wf_container_of(item, struct wf_impl_filesystem, item);
wf_impl_filesystem_dispose(filesystem);
item = next;
@@ -116,7 +116,7 @@ void wf_impl_session_onwritable(
if (!wf_slist_empty(&session->messages))
{
struct wf_slist_item * item = wf_slist_remove_first(&session->messages);
struct wf_message * message = WF_CONTAINER_OF(item, struct wf_message, item);
struct wf_message * message = wf_container_of(item, struct wf_message, item);
lws_write(session->wsi, (unsigned char*) message->data, message->length, LWS_WRITE_TEXT);
wf_message_dispose(message);
@@ -160,7 +160,7 @@ static struct wf_impl_filesystem * wf_impl_session_get_filesystem(
while (NULL != item)
{
struct wf_slist_item * next = item->next;
struct wf_impl_filesystem * filesystem = WF_CONTAINER_OF(session->filesystems.first, struct wf_impl_filesystem, item);
struct wf_impl_filesystem * filesystem = wf_container_of(session->filesystems.first, struct wf_impl_filesystem, item);
if (wsi == filesystem->wsi)
{
result = filesystem;

View File

@@ -16,7 +16,7 @@ void wf_impl_session_manager_cleanup(
while (NULL != item)
{
struct wf_slist_item * next = item->next;
struct wf_impl_session * session = WF_CONTAINER_OF(item, struct wf_impl_session, item);
struct wf_impl_session * session = wf_container_of(item, struct wf_impl_session, item);
wf_impl_session_dispose(session);
item = next;
@@ -51,7 +51,7 @@ struct wf_impl_session * wf_impl_session_manager_get(
while (NULL != item)
{
struct wf_slist_item * next = item->next;
struct wf_impl_session * current = WF_CONTAINER_OF(item, struct wf_impl_session, item);
struct wf_impl_session * current = wf_container_of(item, struct wf_impl_session, item);
if (wf_impl_session_contains_wsi(current, wsi)) {
session = current;
@@ -73,7 +73,7 @@ void wf_impl_session_manager_remove(
while (NULL != item)
{
struct wf_slist_item * next = item->next;
struct wf_impl_session * session = WF_CONTAINER_OF(item, struct wf_impl_session, item);
struct wf_impl_session * session = wf_container_of(item, struct wf_impl_session, item);
if (wsi == session->wsi)
{
wf_slist_remove_after(&manager->sessions, prev);