libqrtr: Use size_t for offsets

Currently, offsetof produces an unsigned long, while qmi_elem_info's
offset member is a uint32_t. Since this is not the same type on all
platforms, this change uses a size_t for both. stddef.h is also
included for the standard offsetof definition, which also produces a
size_t.

This change also makes similar modifications to list.h.
This commit is contained in:
Alex Khouderchah
2020-02-05 11:20:30 -08:00
committed by Bjorn Andersson
parent 2ed52a30f6
commit fef484babd
2 changed files with 6 additions and 3 deletions

View File

@@ -1,8 +1,10 @@
#ifndef _LIST_H_
#define _LIST_H_
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, md) ((unsigned long)&((type *)0)->md)
#define offsetof(type, md) ((size_t)&((type *)0)->md)
#endif
#ifndef container_of