const __u32 *p;
unsigned int res = 0;
- while (((((unsigned long) cp) & 3) != 0) && (nbytes > 0)) {
+ while (((((uintptr_t) cp) & 3) != 0) && (nbytes > 0)) {
res += popcount8(*cp++);
nbytes--;
}
pos = ((unsigned char *)bp->bitarray) + (bitpos >> 3);
/* scan bytes until 8-byte (64-bit) aligned */
- while (count >= 8 && (((unsigned long)pos) & 0x07)) {
+ while (count >= 8 && (((uintptr_t)pos) & 0x07)) {
if (*pos != 0xff) {
byte_found = 1;
break;
pos = ((unsigned char *)bp->bitarray) + (bitpos >> 3);
/* scan bytes until 8-byte (64-bit) aligned */
- while (count >= 8 && (((unsigned long)pos) & 0x07)) {
+ while (count >= 8 && (((uintptr_t)pos) & 0x07)) {
if (*pos != 0) {
byte_found = 1;
break;
uint32_t q;
/* Align it */
- if (unlikely((long)buf & 3 && len)) {
+ if (unlikely((uintptr_t)buf & 3 && len)) {
do {
DO_CRC(*buf++);
- } while ((--len) && ((long)buf)&3);
+ } while ((--len) && ((uintptr_t)buf)&3);
}
# if CRC_LE_BITS == 32
#endif /* _*_TYPES_H */
+#include <stdint.h>
+
/* endian checking stuff */
#ifndef EXT2_ENDIAN_H_
#define EXT2_ENDIAN_H_
else
#endif
*p = malloc(size);
- if ((unsigned long) *p & (align - 1)) {
+ if ((uintptr_t) *p & (align - 1)) {
free(*p);
*p = 0;
}
#define _LINUX_RBTREE_H
#include <stdlib.h>
+#include <stdint.h>
#undef offsetof
#ifdef __compiler_offsetof
struct rb_node
{
- unsigned long rb_parent_color;
+ uintptr_t rb_parent_color;
#define RB_RED 0
#define RB_BLACK 1
struct rb_node *rb_right;
static inline void ext2fs_rb_set_parent(struct rb_node *rb, struct rb_node *p)
{
- rb->rb_parent_color = (rb->rb_parent_color & 3) | (unsigned long)p;
+ rb->rb_parent_color = (rb->rb_parent_color & 3) | (uintptr_t)p;
}
static inline void ext2fs_rb_set_color(struct rb_node *rb, int color)
{
struct rb_node * parent,
struct rb_node ** rb_link)
{
- node->rb_parent_color = (unsigned long )parent;
+ node->rb_parent_color = (uintptr_t)parent;
node->rb_left = node->rb_right = NULL;
*rb_link = node;
struct struct_io_stats io_stats;
};
-#define IS_ALIGNED(n, align) ((((unsigned long) n) & \
- ((unsigned long) ((align)-1))) == 0)
+#define IS_ALIGNED(n, align) ((((uintptr_t) n) & \
+ ((uintptr_t) ((align)-1))) == 0)
static errcode_t unix_get_stats(io_channel channel, io_stats *stats)
{
typedef __signed__ long long __s64;
#endif
+#include <stdint.h> //uintptr_t
+
/* endian checking stuff */
#ifndef EXT2_ENDIAN_H_
#define EXT2_ENDIAN_H_