VirtualBox

Changeset 1816 in vbox


Ignore:
Timestamp:
Mar 29, 2007 6:59:35 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
19999
Message:

moved magics to a common header to avoid duplicating the same defines all over the place.

Location:
trunk/src/VBox/Runtime
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/alloc/heapsimple.cpp

    r331 r1816  
    3232#include <iprt/log.h>
    3333#include <iprt/param.h>
     34
     35#include "internal/magics.h"
    3436
    3537
     
    145147} RTHEAPSIMPLEINTERNAL;
    146148AssertCompileSizeAlignment(RTHEAPSIMPLEINTERNAL, 32);
    147 
    148 /** Magic number for RTHEAPSIMPLEINTERNAL::u32Magic. (Kyoichi Katayama) */
    149 #define RTHEAPSIMPLE_MAGIC  0x19590105
    150149
    151150
  • trunk/src/VBox/Runtime/generic/semsrw-generic.cpp

    r403 r1816  
    7373#endif
    7474};
    75 
    76 /** RTSEMRWINTERNAL::u32Magic value. (Kosuke Fujishima) */
    77 #define RTSEMRW_MAGIC   0x19640707
    7875
    7976
  • trunk/src/VBox/Runtime/generic/spinlock-generic.cpp

    r1 r1816  
    4242#endif
    4343
     44#include "internal/magics.h"
     45
    4446
    4547/*******************************************************************************
     
    5759} RTSPINLOCKINTERNAL, *PRTSPINLOCKINTERNAL;
    5860
    59 /** Magic value for RTSPINLOCKINTERNAL::u32Magic. (Terry Pratchett) */
    60 #define RTSPINLOCK_MAGIC    0x19480428
    6161
    6262RTDECL(int)  RTSpinlockCreate(PRTSPINLOCK pSpinlock)
  • trunk/src/VBox/Runtime/include/internal/dir.h

    r1 r1816  
    2626#include <iprt/cdefs.h>
    2727#include <iprt/types.h>
     28#include "internal/magics.h"
    2829
    2930
     
    9899} RTDIR;
    99100
    100 /** The value of RTDIR::u32Magic. (Michael Ende) */
    101 #define RTDIR_MAGIC                 0x19291112
    102  /** The value of RTDIR::u32Magic after RTDirClose().  */
    103 #define RTDIR_MAGIC_DEAD            0x19950829
    104 
    105101
    106102/**
  • trunk/src/VBox/Runtime/include/internal/ldr.h

    r1 r1816  
    2424
    2525#include <iprt/types.h>
     26#include "internal/magics.h"
    2627
    2728__BEGIN_DECLS
     
    320321} RTLDRMODINTERNAL;
    321322
    322 /** The magic value for RTLDRMODINTERNAL::u32Magic. (Alan Moore) */
    323 #define RTLDRMOD_MAGIC  0x19531118
    324 
    325323
    326324/**
  • trunk/src/VBox/Runtime/include/internal/magics.h

    • Property svn:keywords set to Id
    r1815 r1816  
    1 /* $Id: $ */
     1/* $Id$ */
    22/** @file
    33 * InnoTek Portable Runtime - Internal Header Defining The Magic Numbers.
     
    2222 */
    2323
    24 #ifndef INCLUDED_internal_magics_h
    25 #define INCLUDED_internal_magics_h
     24#ifndef ___internal_magics_h___
     25#define ___internal_magics_h___
    2626
    2727/** @name Magic Numbers.
    2828 * @{ */
    2929
     30/** The value of RTDIR::u32Magic. (Michael Ende) */
     31#define RTDIR_MAGIC                 0x19291112
     32/** The value of RTDIR::u32Magic after RTDirClose().  */
     33#define RTDIR_MAGIC_DEAD            0x19950829
     34/** Magic number for RTHEAPSIMPLEINTERNAL::u32Magic. (Kyoichi Katayama) */
     35#define RTHEAPSIMPLE_MAGIC          0x19590105
     36/** The magic value for RTLDRMODINTERNAL::u32Magic. (Alan Moore) */
     37#define RTLDRMOD_MAGIC              0x19531118
     38/** Magic number for heap blocks. (Edgar Allan Poe) */
     39#define RTMEMHDR_MAGIC              0x18090119
     40/** RTR0MEMOBJ::u32Magic. (Masakazu Katsura) */
     41#define RTR0MEMOBJ_MAGIC            0x19611210
     42/** Magic for the event semaphore structure. (Neil Gaiman) */
     43#define RTSEMEVENT_MAGIC            0x19601110
     44/** Magic for the multiple release event semaphore structure. (Isaac Asimov) */
     45#define RTSEMEVENTMULTI_MAGIC       0x19200102
     46/** Magic value for RTSEMFASTMUTEXINTERNAL::u32Magic. (John Ronald Reuel Tolkien) */
     47#define RTSEMFASTMUTEX_MAGIC        0x18920102
     48/** Dead magic value for RTSEMFASTMUTEXINTERNAL::u32Magic. */
     49#define RTSEMFASTMUTEX_MAGIC_DEAD   0x19730902
     50/** Magic for the mutex semaphore structure. (Douglas Adams) */
     51#define RTSEMMUTEX_MAGIC            0x19520311
     52/** Dead magic for the mutex semaphore structure. */
     53#define RTSEMMUTEX_MAGIC_DEAD       0x20010511
     54/** RTSEMRWINTERNAL::u32Magic value. (Kosuke Fujishima) */
     55#define RTSEMRW_MAGIC               0x19640707
     56/** Magic value for RTSPINLOCKINTERNAL::u32Magic. (Terry Pratchett) */
     57#define RTSPINLOCK_MAGIC            0x19480428
     58/** The value of RTSTREAM::u32Magic for a valid stream. */
     59#define RTSTREAM_MAGIC              0xe44e44ee
     60/** RTTHREADINT::u32Magic value. (Gilbert Keith Chesterton) */
     61#define RTTHREADINT_MAGIC           0x18740529
     62/** RTTHREADINT::u32Magic value for a dead thread. */
     63#define RTTHREADINT_MAGIC_DEAD      0x19360614
    3064/** Magic number for timer handles. (Jared Mason Diamond) */
    31 #define RTTIMER_MAGIC   0x19370910
     65#define RTTIMER_MAGIC               0x19370910
    3266
    3367/** @} */
  • trunk/src/VBox/Runtime/include/internal/memobj.h

    r1300 r1816  
    2525#include <iprt/memobj.h>
    2626#include <iprt/assert.h>
     27#include "internal/magics.h"
    2728
    2829
     
    188189} RTR0MEMOBJINTERNAL;
    189190
    190 /** RTR0MEMOBJ::u32Magic. (Masakazu Katsura) */
    191 #define RTR0MEMOBJ_MAGIC   0x19611210
    192 
    193191
    194192/**
  • trunk/src/VBox/Runtime/include/internal/thread.h

    r1766 r1816  
    3030# include <iprt/critsect.h>
    3131#endif
     32#include "internal/magics.h"
    3233
    3334__BEGIN_DECLS
     
    131132} RTTHREADINT, *PRTTHREADINT;
    132133
    133 /** RTTHREADINT::u32Magic value. (Gilbert Keith Chesterton) */
    134 #define RTTHREADINT_MAGIC       0x18740529
    135 /** RTTHREADINT::u32Magic value for a dead thread. */
    136 #define RTTHREADINT_MAGIC_DEAD  0x19360614
    137134
    138135/** @name RTTHREADINT::fIntFlags Masks and Bits.
  • trunk/src/VBox/Runtime/r0drv/alloc-r0drv.h

    r289 r1816  
    2525#include <iprt/cdefs.h>
    2626#include <iprt/types.h>
     27#include "internal/magics.h"
    2728
    2829__BEGIN_DECLS
     
    4344} RTMEMHDR, *PRTMEMHDR;
    4445
    45 /** Magic number for heap blocks. (Edgar Allan Poe) */
    46 #define RTMEMHDR_MAGIC      0x18090119
    4746
    4847/** @name RTMEMHDR::fFlags.
  • trunk/src/VBox/Runtime/r0drv/darwin/semaphore-r0drv-darwin.cpp

    r1189 r1816  
    2626*******************************************************************************/
    2727#include "the-darwin-kernel.h"
     28
    2829#include <iprt/semaphore.h>
    2930#include <iprt/alloc.h>
     
    3132#include <iprt/asm.h>
    3233#include <iprt/err.h>
     34
     35#include "internal/magics.h"
    3336
    3437
     
    5356} RTSEMEVENTINTERNAL, *PRTSEMEVENTINTERNAL;
    5457
    55 /** Magic for the Darwin event semaphore structure. (Neil Gaiman) */
    56 #define RTSEMEVENT_MAGIC 0x19601110
    57 
    5858
    5959/**
     
    7474} RTSEMEVENTMULTIINTERNAL, *PRTSEMEVENTMULTIINTERNAL;
    7575
    76 /** Magic for the Darwin multiple release event semaphore structure. (Isaac Asimov) */
    77 #define RTSEMEVENTMULTI_MAGIC 0x19200102
    78 
    7976
    8077#if 0 /** @todo */
     
    9087} RTSEMMUTEXINTERNAL, *PRTSEMMUTEXINTERNAL;
    9188
    92 /** Magic for the Darwin mutex semaphore structure. (Douglas Adams) */
    93 #define RTSEMMUTEX_MAGIC 0x19520311
    9489#endif
    9590
     
    106101} RTSEMFASTMUTEXINTERNAL, *PRTSEMFASTMUTEXINTERNAL;
    107102
    108 /** Magic value for RTSEMFASTMUTEXINTERNAL::u32Magic (John Ronald Reuel Tolkien). */
    109 #define RTSEMFASTMUTEX_MAGIC    0x18920102
    110103
    111104
  • trunk/src/VBox/Runtime/r0drv/darwin/spinlock-r0drv-darwin.cpp

    r1 r1816  
    3131#include <iprt/asm.h>
    3232
     33#include "internal/magics.h"
     34
    3335
    3436/*******************************************************************************
     
    4547    lck_spin_t         *pSpinLock;
    4648} RTSPINLOCKINTERNAL, *PRTSPINLOCKINTERNAL;
    47 
    48 /** Magic value for RTSPINLOCKINTERNAL::u32Magic. (Terry Pratchett) */
    49 #define RTSPINLOCK_MAGIC    0x19480428
    5049
    5150
  • trunk/src/VBox/Runtime/r0drv/linux/semaphore-r0drv-linux.c

    r1 r1816  
    3232#include <iprt/err.h>
    3333
     34#include "internal/magics.h"
     35
    3436
    3537/*******************************************************************************
     
    4850    wait_queue_head_t   Head;
    4951} RTSEMEVENTINTERNAL, *PRTSEMEVENTINTERNAL;
    50 
    51 /** Magic for the Linux event semaphore structure. (Neil Gaiman) */
    52 #define RTSEMEVENT_MAGIC 0x19601110
    5352
    5453
     
    6867} RTSEMMUTEXINTERNAL, *PRTSEMMUTEXINTERNAL;
    6968
    70 /** Magic for the Linux mutex semaphore structure. (Douglas Adams) */
    71 #define RTSEMMUTEX_MAGIC 0x19520311
    72 
    7369
    7470/**
     
    8278    struct semaphore    Semaphore;
    8379} RTSEMFASTMUTEXINTERNAL, *PRTSEMFASTMUTEXINTERNAL;
    84 
    85 /** Magic value for RTSEMFASTMUTEXINTERNAL::u32Magic (John Ronald Reuel Tolkien). */
    86 #define RTSEMFASTMUTEX_MAGIC    0x18920102
    8780
    8881
  • trunk/src/VBox/Runtime/r0drv/linux/spinlock-r0drv-linux.c

    r1 r1816  
    2525*******************************************************************************/
    2626#include "the-linux-kernel.h"
     27
    2728#include <iprt/spinlock.h>
    2829#include <iprt/err.h>
     
    3031#include <iprt/assert.h>
    3132#include <iprt/asm.h>
     33#include "internal/magics.h"
    3234
    33 #include <linux/spinlock.h>
     35#include <linux/spinlock.h> /** @todo why is this here and not in the-linux-kernel.h? */
     36
    3437
    3538/*******************************************************************************
     
    5053#endif
    5154} RTSPINLOCKINTERNAL, *PRTSPINLOCKINTERNAL;
    52 
    53 /** Magic value for RTSPINLOCKINTERNAL::u32Magic. (Terry Pratchett) */
    54 #define RTSPINLOCK_MAGIC    0x19480428
    5555
    5656
  • trunk/src/VBox/Runtime/r0drv/nt/semaphore-r0drv-nt.cpp

    r1 r1816  
    3232#include <iprt/err.h>
    3333
     34#include "internal/magics.h"
     35
    3436
    3537/*******************************************************************************
     
    4749} RTSEMEVENTINTERNAL, *PRTSEMEVENTINTERNAL;
    4850
    49 /** Magic for the NT event semaphore structure. (Neil Gaiman) */
    50 #define RTSEMEVENT_MAGIC 0x19601110
    5151
    5252
     
    6767} RTSEMMUTEXINTERNAL, *PRTSEMMUTEXINTERNAL;
    6868
    69 /** Magic for the NT mutex semaphore structure. (Douglas Adams) */
    70 #define RTSEMMUTEX_MAGIC 0x19520311
    7169
    7270
     
    8280} RTSEMFASTMUTEXINTERNAL, *PRTSEMFASTMUTEXINTERNAL;
    8381
    84 /** Magic value for RTSEMFASTMUTEXINTERNAL::u32Magic (John Ronald Reuel Tolkien). */
    85 #define RTSEMFASTMUTEX_MAGIC    0x18920102
    8682
    8783
  • trunk/src/VBox/Runtime/r0drv/nt/spinlock-r0drv-nt.cpp

    r1 r1816  
    2525*******************************************************************************/
    2626#include "the-nt-kernel.h"
     27
    2728#include <iprt/spinlock.h>
    2829#include <iprt/err.h>
     
    3031#include <iprt/assert.h>
    3132#include <iprt/asm.h>
     33
     34#include "internal/magics.h"
    3235
    3336
     
    4548    KSPIN_LOCK          Spinlock;
    4649} RTSPINLOCKINTERNAL, *PRTSPINLOCKINTERNAL;
    47 
    48 /** Magic value for RTSPINLOCKINTERNAL::u32Magic. (Terry Pratchett) */
    49 #define RTSPINLOCK_MAGIC    0x19480428
    5050
    5151
  • trunk/src/VBox/Runtime/r0drv/os2/semevent-r0drv-os2.cpp

    r1191 r1816  
    4141#include <iprt/err.h>
    4242
     43#include "internal/magics.h"
     44
    4345
    4446/*******************************************************************************
     
    6163    SpinLock_t          Spinlock;
    6264} RTSEMEVENTINTERNAL, *PRTSEMEVENTINTERNAL;
    63 
    64 /** Magic for the OS/2 event semaphore structure. (Neil Gaiman) */
    65 #define RTSEMEVENT_MAGIC 0x19601110
    6665
    6766
  • trunk/src/VBox/Runtime/r0drv/os2/semeventmulti-r0drv-os2.cpp

    r1191 r1816  
    4040#include <iprt/assert.h>
    4141#include <iprt/err.h>
     42#include "internal/magics.h"
    4243
    4344
     
    6162    SpinLock_t          Spinlock;
    6263} RTSEMEVENTMULTIINTERNAL, *PRTSEMEVENTMULTIINTERNAL;
    63 
    64 /** Magic for the OS/2 multiple release event semaphore structure. (Isaac Asimov) */
    65 #define RTSEMEVENTMULTI_MAGIC 0x19200102
    6664
    6765
  • trunk/src/VBox/Runtime/r0drv/os2/semfastmutex-r0drv-os2.cpp

    r1191 r1816  
    4040#include <iprt/asm.h>
    4141
     42#include "internal/magics.h"
     43
    4244
    4345/*******************************************************************************
     
    5456    MutexLock_t         Mtx;
    5557} RTSEMFASTMUTEXINTERNAL, *PRTSEMFASTMUTEXINTERNAL;
    56 
    57 /** Magic value for RTSEMFASTMUTEXINTERNAL::u32Magic (John Ronald Reuel Tolkien). */
    58 #define RTSEMFASTMUTEX_MAGIC        0x18920102
    59 /** Dead magic value. */
    60 #define RTSEMFASTMUTEX_MAGIC_DEAD   0x0000000 /// @todo
    6158
    6259
  • trunk/src/VBox/Runtime/r0drv/os2/spinlock-r0drv-os2.cpp

    r1191 r1816  
    4040#include <iprt/asm.h>
    4141
     42#include "internal/magics.h"
     43
    4244
    4345/*******************************************************************************
     
    5456    SpinLock_t          Spinlock;
    5557} RTSPINLOCKINTERNAL, *PRTSPINLOCKINTERNAL;
    56 
    57 /** Magic value for RTSPINLOCKINTERNAL::u32Magic. (Terry Pratchett) */
    58 #define RTSPINLOCK_MAGIC    0x19480428
    59 
    6058
    6159
  • trunk/src/VBox/Runtime/r0drv/os2/timer-r0drv-os2.cpp

    r1191 r1816  
    4242#include <iprt/assert.h>
    4343#include <iprt/alloc.h>
     44
     45#include "internal/magics.h"
    4446
    4547
     
    7981} RTTIMER;
    8082
    81 /** Magic number for timer handles. (Jared Mason Diamond) */
    82 #define RTTIMER_MAGIC       0x19370910
    83 
    8483
    8584/*******************************************************************************
  • trunk/src/VBox/Runtime/r3/linux/sems-linux.cpp

    r849 r1816  
    2828#include <iprt/asm.h>
    2929#include <iprt/err.h>
     30#include "internal/magics.h"
    3031
    3132#include <errno.h>
     
    6263};
    6364
    64 #define RTSEMEVENT_MAGIC    ((intptr_t)-16)
    65 
    6665
    6766/**
     
    8079};
    8180
    82 #define RTSEMEVENTMULTI_MAGIC ((intptr_t)-128)
    8381
    8482/**
  • trunk/src/VBox/Runtime/r3/posix/alloc-posix.cpp

    r845 r1816  
    5757} RTMEMEXECHDR, *PRTMEMEXECHDR;
    5858
    59 /** MAgic for RTMEMEXECHDR. */
     59/** Magic for RTMEMEXECHDR. */
    6060#define RTMEMEXECHDR_MAGIC (~(size_t)0xfeedbabe)
    6161
  • trunk/src/VBox/Runtime/r3/stream.cpp

    r537 r1816  
    3333#include <iprt/param.h>
    3434#include <iprt/string.h>
     35#include "internal/magics.h"
    3536
    3637#include <stdio.h>
     
    5758    FILE                *pFile;
    5859} RTSTREAM;
    59 
    60 /** The value of RTSTREAM::u32Magic for a valid stream. */
    61 #define RTSTREAM_MAGIC  0xe44e44ee
    6260
    6361
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette