VirtualBox

Changeset 23974 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Oct 22, 2009 12:41:16 PM (15 years ago)
Author:
vboxsync
Message:

iprt/file.h: Use UINT32_C() for the RTFILE_O flags.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/file.h

    r23973 r23974  
    7171 * @{ */
    7272/** Open the file with read access. */
    73 #define RTFILE_O_READ                   0x00000001
     73#define RTFILE_O_READ                   UINT32_C(0x00000001)
    7474/** Open the file with write access. */
    75 #define RTFILE_O_WRITE                  0x00000002
     75#define RTFILE_O_WRITE                  UINT32_C(0x00000002)
    7676/** Open the file with read & write access. */
    77 #define RTFILE_O_READWRITE              0x00000003
     77#define RTFILE_O_READWRITE              UINT32_C(0x00000003)
    7878/** The file access mask.
    7979 * @remarks The value 0 is invalid. */
    80 #define RTFILE_O_ACCESS_MASK            0x00000003
     80#define RTFILE_O_ACCESS_MASK            UINT32_C(0x00000003)
    8181
    8282/** Open file in APPEND mode, so all writes to the file handle will
     
    8484 * @remarks It is ignored if write access is not requested, that is
    8585 *          RTFILE_O_WRITE is not set. */
    86 #define RTFILE_O_APPEND                 0x00000004
    87                                      /* 0x00000008 is unused atm. */
     86#define RTFILE_O_APPEND                 UINT32_C(0x00000004)
     87                                     /* UINT32_C(0x00000008) is unused atm. */
    8888
    8989/** Sharing mode: deny none. */
    90 #define RTFILE_O_DENY_NONE              0x00000080
     90#define RTFILE_O_DENY_NONE              UINT32_C(0x00000080)
    9191/** Sharing mode: deny read. */
    92 #define RTFILE_O_DENY_READ              0x00000010
     92#define RTFILE_O_DENY_READ              UINT32_C(0x00000010)
    9393/** Sharing mode: deny write. */
    94 #define RTFILE_O_DENY_WRITE             0x00000020
     94#define RTFILE_O_DENY_WRITE             UINT32_C(0x00000020)
    9595/** Sharing mode: deny read and write. */
    96 #define RTFILE_O_DENY_READWRITE         0x00000030
     96#define RTFILE_O_DENY_READWRITE         UINT32_C(0x00000030)
    9797/** Sharing mode: deny all. */
    9898#define RTFILE_O_DENY_ALL               RTFILE_O_DENY_READWRITE
     
    101101 *          defaulted & ignored on those.
    102102 */
    103 #define RTFILE_O_DENY_NOT_DELETE        0x00000040
     103#define RTFILE_O_DENY_NOT_DELETE        UINT32_C(0x00000040)
    104104/** Sharing mode mask. */
    105 #define RTFILE_O_DENY_MASK              0x000000f0
     105#define RTFILE_O_DENY_MASK              UINT32_C(0x000000f0)
    106106
    107107/** Action: Open an existing file (the default action). */
    108 #define RTFILE_O_OPEN                   0x00000700
     108#define RTFILE_O_OPEN                   UINT32_C(0x00000700)
    109109/** Action: Create a new file or open an existing one. */
    110 #define RTFILE_O_OPEN_CREATE            0x00000100
     110#define RTFILE_O_OPEN_CREATE            UINT32_C(0x00000100)
    111111/** Action: Create a new a file. */
    112 #define RTFILE_O_CREATE                 0x00000200
     112#define RTFILE_O_CREATE                 UINT32_C(0x00000200)
    113113/** Action: Create a new file or replace an existing one. */
    114 #define RTFILE_O_CREATE_REPLACE         0x00000300
     114#define RTFILE_O_CREATE_REPLACE         UINT32_C(0x00000300)
    115115/** Action mask. */
    116 #define RTFILE_O_ACTION_MASK            0x00000700
     116#define RTFILE_O_ACTION_MASK            UINT32_C(0x00000700)
    117117
    118118/** Turns off indexing of files on Windows hosts, *CREATE* only.
    119119 * @remarks Window only. */
    120 #define RTFILE_O_NOT_CONTENT_INDEXED    0x00000800
     120#define RTFILE_O_NOT_CONTENT_INDEXED    UINT32_C(0x00000800)
    121121/** Truncate the file.
    122122 * @remarks This will not truncate files opened for read-only.
     
    124124 *          the file may be racing us. The caller is responsible for not causing
    125125 *          this race. */
    126 #define RTFILE_O_TRUNCATE               0x00001000
     126#define RTFILE_O_TRUNCATE               UINT32_C(0x00001000)
    127127/** Make the handle inheritable on RTProcessCreate(/exec). */
    128 #define RTFILE_O_INHERIT                0x00002000
     128#define RTFILE_O_INHERIT                UINT32_C(0x00002000)
    129129/** Open file in non-blocking mode - non-portable.
    130130 * @remarks This flag may not be supported on all platforms, in which case it's
    131131 *          considered an invalid parameter. */
    132 #define RTFILE_O_NON_BLOCK              0x00004000
     132#define RTFILE_O_NON_BLOCK              UINT32_C(0x00004000)
    133133/** Write through directly to disk. Workaround to avoid iSCSI
    134134 * initiator deadlocks on Windows hosts.
    135135 * @remarks This might not be implemented on all platforms, and will be ignored
    136136 *          on those. */
    137 #define RTFILE_O_WRITE_THROUGH          0x00008000
     137#define RTFILE_O_WRITE_THROUGH          UINT32_C(0x00008000)
    138138
    139139/** Attribute access: Attributes can be read if the file is being opened with
    140140 * read access, and can be written with write access. */
    141 #define RTFILE_O_ACCESS_ATTR_DEFAULT    0x00000000
     141#define RTFILE_O_ACCESS_ATTR_DEFAULT    UINT32_C(0x00000000)
    142142/** Attribute access: Attributes can be read.
    143143 * @remarks Windows only.  */
    144 #define RTFILE_O_ACCESS_ATTR_READ       0x00010000
     144#define RTFILE_O_ACCESS_ATTR_READ       UINT32_C(0x00010000)
    145145/** Attribute access: Attributes can be written.
    146146 * @remarks Windows only.  */
    147 #define RTFILE_O_ACCESS_ATTR_WRITE      0x00020000
     147#define RTFILE_O_ACCESS_ATTR_WRITE      UINT32_C(0x00020000)
    148148/** Attribute access: Attributes can be both read & written.
    149149 * @remarks Windows only.  */
    150 #define RTFILE_O_ACCESS_ATTR_READWRITE  0x00030000
     150#define RTFILE_O_ACCESS_ATTR_READWRITE  UINT32_C(0x00030000)
    151151/** Attribute access: The file attributes access mask.
    152152 * @remarks Windows only.  */
    153 #define RTFILE_O_ACCESS_ATTR_MASK       0x00030000
     153#define RTFILE_O_ACCESS_ATTR_MASK       UINT32_C(0x00030000)
    154154
    155155/** Open file for async I/O
    156156 * @remarks This flag may not be needed on all platforms, and will be ignored on
    157157 *          those. */
    158 #define RTFILE_O_ASYNC_IO               0x00040000
     158#define RTFILE_O_ASYNC_IO               UINT32_C(0x00040000)
    159159
    160160/** Disables caching.
     
    183183 *          and will be ignored on those.
    184184 */
    185 #define RTFILE_O_NO_CACHE               0x00080000
     185#define RTFILE_O_NO_CACHE               UINT32_C(0x00080000)
    186186
    187187/** Unix file mode mask for use when creating files. */
    188 #define RTFILE_O_CREATE_MODE_MASK       0x1ff00000
     188#define RTFILE_O_CREATE_MODE_MASK       UINT32_C(0x1ff00000)
    189189/** The number of bits to shift to get the file mode mask.
    190190 * To extract it: (fFlags & RTFILE_O_CREATE_MODE_MASK) >> RTFILE_O_CREATE_MODE_SHIFT.
     
    192192#define RTFILE_O_CREATE_MODE_SHIFT      20
    193193
    194                                       /*0x20000000,
    195                                         0x40000000
    196                                     and 0x80000000 are unused atm. */
     194                                      /*UINT32_C(0x20000000),
     195                                        UINT32_C(0x40000000)
     196                                    and UINT32_C(0x80000000) are unused atm. */
    197197
    198198/** Mask of all valid flags.
    199199 * @remark  This doesn't validate the access mode properly.
    200200 */
    201 #define RTFILE_O_VALID_MASK             0x1ffFFFF7
     201#define RTFILE_O_VALID_MASK             UINT32_C(0x1ffffff7)
    202202
    203203/** @} */
Note: See TracChangeset for help on using the changeset viewer.

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