Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 0b4a67a in mainline


Ignore:
Timestamp:
2010-11-20T15:33:02Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
7e1f9b7
Parents:
a9c6b966
Message:

Use a more portable definition of NULL.

Files:
20 edited

Legend:

Unmodified
Added
Removed
  • boot/generic/include/typedefs.h

    ra9c6b966 r0b4a67a  
    3737#include <arch/types.h>
    3838
    39 #define NULL  0
     39#define NULL    ((void *) 0)
    4040
    4141#define false  0
  • kernel/arch/amd64/src/debugger.c

    ra9c6b966 r0b4a67a  
    260260        }
    261261       
    262         cur->address = NULL;
     262        cur->address = (uintptr_t) NULL;
    263263       
    264264        setup_dr(slot);
     
    313313        unsigned int i;
    314314        for (i = 0; i < BKPOINTS_MAX; i++)
    315                 breakpoints[i].address = NULL;
     315                breakpoints[i].address = (uintptr_t) NULL;
    316316       
    317317#ifdef CONFIG_KCONSOLE
  • kernel/arch/mips32/src/debugger.c

    ra9c6b966 r0b4a67a  
    247247        smc_coherence(((uint32_t *) cur->address)[1]);
    248248       
    249         cur->address = NULL;
     249        cur->address = (uintptr_t) NULL;
    250250       
    251251        irq_spinlock_unlock(&bkpoint_lock, true);
     
    289289       
    290290        for (i = 0; i < BKPOINTS_MAX; i++)
    291                 breakpoints[i].address = NULL;
     291                breakpoints[i].address = (uintptr_t) NULL;
    292292       
    293293#ifdef CONFIG_KCONSOLE
     
    417417                /* Remove one-shot breakpoint */
    418418                if ((cur->flags & BKPOINT_ONESHOT))
    419                         cur->address = NULL;
     419                        cur->address = (uintptr_t) NULL;
    420420               
    421421                /* Remove in-progress flag */
  • kernel/arch/sparc64/src/mm/sun4u/frame.c

    ra9c6b966 r0b4a67a  
    4141#include <macros.h>
    4242
    43 uintptr_t last_frame = NULL;
     43uintptr_t last_frame = (uintptr_t) NULL;
    4444
    4545/** Create memory zones according to information stored in memmap.
  • kernel/generic/include/typedefs.h

    ra9c6b966 r0b4a67a  
    4040#include <arch/types.h>
    4141
    42 #define NULL  0UL
     42#define NULL    ((void *) 0)
    4343
    4444#define false  0
  • kernel/generic/src/main/main.c

    ra9c6b966 r0b4a67a  
    9797/** Boot allocations. */
    9898ballocs_t ballocs = {
    99         .base = NULL,
     99        .base = (uintptr_t) NULL,
    100100        .size = 0
    101101};
  • kernel/generic/src/mm/as.c

    ra9c6b966 r0b4a67a  
    312312         *
    313313         */
    314         if (overlaps(va, size, NULL, PAGE_SIZE))
     314        if (overlaps(va, size, (uintptr_t) NULL, PAGE_SIZE))
    315315                return false;
    316316       
  • kernel/generic/src/mm/frame.c

    ra9c6b966 r0b4a67a  
    878878                 * the assert
    879879                 */
    880                 ASSERT(confframe != NULL);
     880                ASSERT(confframe != ADDR2PFN((uintptr_t ) NULL));
    881881               
    882882                /* If confframe is supposed to be inside our zone, then make sure
     
    11041104         */
    11051105        pfn_t pfn = ADDR2PFN(frame);
    1106         size_t znum = find_zone(pfn, 1, NULL);
     1106        size_t znum = find_zone(pfn, 1, 0);
    11071107       
    11081108        ASSERT(znum != (size_t) -1);
     
    11411141         * First, find host frame zone for addr.
    11421142         */
    1143         size_t znum = find_zone(pfn, 1, NULL);
     1143        size_t znum = find_zone(pfn, 1, 0);
    11441144       
    11451145        ASSERT(znum != (size_t) -1);
  • kernel/generic/src/synch/smc.c

    ra9c6b966 r0b4a67a  
    4444unative_t sys_smc_coherence(uintptr_t va, size_t size)
    4545{
    46         if (overlaps(va, size, NULL, PAGE_SIZE))
     46        if (overlaps(va, size, (uintptr_t) NULL, PAGE_SIZE))
    4747                return EINVAL;
    4848
  • uspace/app/bdsh/cmds/builtins/builtins.h

    ra9c6b966 r0b4a67a  
    1010#include "cd/cd_def.h"
    1111#include "exit/exit_def.h"
    12         {NULL, NULL, NULL, NULL, NULL}
     12        {NULL, NULL, NULL, NULL, 0}
    1313};
    1414
  • uspace/app/nettest1/nettest1.c

    ra9c6b966 r0b4a67a  
    388388                return ENOMEM;
    389389        }
    390         socket_ids[sockets] = NULL;
     390        socket_ids[sockets] = 0;
    391391
    392392        if (verbose)
  • uspace/app/nettest2/nettest2.c

    ra9c6b966 r0b4a67a  
    336336                return ENOMEM;
    337337        }
    338         socket_ids[sockets] = NULL;
     338        socket_ids[sockets] = 0;
    339339
    340340        if (verbose)
  • uspace/lib/c/arch/abs32le/src/stacktrace.c

    ra9c6b966 r0b4a67a  
    5656uintptr_t stacktrace_fp_get(void)
    5757{
    58         return NULL;
     58        return (uintptr_t) NULL;
    5959}
    6060
    6161uintptr_t stacktrace_pc_get(void)
    6262{
    63         return NULL;
     63        return (uintptr_t) NULL;
    6464}
    6565
  • uspace/lib/c/arch/abs32le/src/tls.c

    ra9c6b966 r0b4a67a  
    4646uintptr_t __aeabi_read_tp(void)
    4747{
    48         return NULL;
     48        return (uintptr_t) NULL;
    4949}
    5050
  • uspace/lib/c/generic/async.c

    ra9c6b966 r0b4a67a  
    536536                if (callid)
    537537                        ipc_answer_0(callid, ENOMEM);
    538                 return NULL;
     538                return (uintptr_t) NULL;
    539539        }
    540540       
     
    556556                if (callid)
    557557                        ipc_answer_0(callid, ENOMEM);
    558                 return NULL;
     558                return (uintptr_t) NULL;
    559559        }
    560560       
  • uspace/lib/c/generic/io/klog.c

    ra9c6b966 r0b4a67a  
    5252void klog_update(void)
    5353{
    54         (void) __SYSCALL3(SYS_KLOG, 1, NULL, 0);
     54        (void) __SYSCALL3(SYS_KLOG, 1, (uintptr_t) NULL, 0);
    5555}
    5656
  • uspace/lib/c/include/unistd.h

    ra9c6b966 r0b4a67a  
    4141
    4242#ifndef NULL
    43         #define NULL  0UL
     43        #define NULL    ((void *) 0)
    4444#endif
    4545
  • uspace/srv/hid/kbd/genarch/gsp.c

    ra9c6b966 r0b4a67a  
    198198        if (t == NULL) {
    199199                printf("gsp_step: not found\n");
    200                 *mods = NULL;
    201                 *key = NULL;
     200                *mods = 0;
     201                *key = 0;
    202202                return 0;
    203203        }
  • uspace/srv/hw/netif/dp8390/dp8390.c

    ra9c6b966 r0b4a67a  
    432432        dep->de_write_iovec.iod_iovec[0].iov_size = size;
    433433        dep->de_write_iovec.iod_iovec_s = 1;
    434         dep->de_write_iovec.iod_iovec_addr = NULL;
     434        dep->de_write_iovec.iod_iovec_addr = (uintptr_t) NULL;
    435435
    436436        if (size < ETH_MIN_PACK_SIZE || size > ETH_MAX_PACK_SIZE_TAGGED)
     
    10151015        dep->de_read_iovec.iod_iovec[0].iov_size = length;
    10161016        dep->de_read_iovec.iod_iovec_s = 1;
    1017         dep->de_read_iovec.iod_iovec_addr = NULL;
     1017        dep->de_read_iovec.iod_iovec_addr = (uintptr_t) NULL;
    10181018
    10191019        last = page + (length - 1) / DP_PAGESIZE;
  • uspace/srv/hw/netif/dp8390/dp8390_module.c

    ra9c6b966 r0b4a67a  
    127127                dep->received_count = 0;
    128128                fibril_rwlock_write_unlock(&netif_globals.lock);
    129                 nil_received_msg(phone, device_id, received, NULL);
     129                nil_received_msg(phone, device_id, received, SERVICE_NONE);
    130130        }else{
    131131                fibril_rwlock_write_unlock(&netif_globals.lock);
Note: See TracChangeset for help on using the changeset viewer.