Ticket #2870: ticket2870.diff

File ticket2870.diff, 15.8 KB (added by scottmc, 15 years ago)

patch to fix comments in OS.h, ByteOrder.h, FindDirectory.h and Mime.h

  • kernel/OS.h

     
    110110    port_id     port;
    111111    team_id     team;
    112112    char        name[B_OS_NAME_LENGTH];
    113     int32       capacity;       // queue depth
    114     int32       queue_count;    // # msgs waiting to be read
    115     int32       total_count;    // total # msgs read so far
     113    int32       capacity;       /* queue depth */
     114    int32       queue_count;    /* # msgs waiting to be read */
     115    int32       total_count;    /* total # msgs read so far */
    116116} port_info;
    117117
    118118extern port_id  create_port(int32 capacity, const char *name);
     
    142142            _get_next_port_info((team), (cookie), (info), sizeof(*(info)))
    143143
    144144
    145 // WARNING: The following is Haiku experimental API. It might be removed or
    146 // changed in the future.
     145/* WARNING: The following is Haiku experimental API. It might be removed or
     146   changed in the future. */
    147147
    148148typedef struct port_message_info {
    149149    size_t      size;
     
    152152    team_id     sender_team;
    153153} port_message_info;
    154154
    155 // similar to port_buffer_size_etc(), but returns (more) info
     155/* similar to port_buffer_size_etc(), but returns (more) info */
    156156extern status_t _get_port_message_info_etc(port_id port,
    157157                    port_message_info *info, size_t infoSize, uint32 flags,
    158158                    bigtime_t timeout);
     
    174174
    175175/* semaphore flags */
    176176enum {
    177     B_CAN_INTERRUPT             = 0x01, // acquisition of the semaphore can be
    178                                         // interrupted (system use only)
    179     B_CHECK_PERMISSION          = 0x04, // ownership will be checked (system use
    180                                         // only)
    181     B_KILL_CAN_INTERRUPT        = 0x20, // acquisition of the semaphore can be
    182                                         // interrupted by SIGKILL[THR], even
    183                                         // if not B_CAN_INTERRUPT (system use
    184                                         // only)
     177    B_CAN_INTERRUPT             = 0x01, /* acquisition of the semaphore can be
     178                                           interrupted (system use only) */
     179    B_CHECK_PERMISSION          = 0x04, /* ownership will be checked (system use
     180                                           only) */
     181    B_KILL_CAN_INTERRUPT        = 0x20, /* acquisition of the semaphore can be
     182                                          interrupted by SIGKILL[THR], even
     183                                          if not B_CAN_INTERRUPT (system use
     184                                           only) */
    185185
    186186    /* release_sem_etc() only flags */
    187     B_DO_NOT_RESCHEDULE         = 0x02, // thread is not rescheduled
    188     B_RELEASE_ALL               = 0x08, // all waiting threads will be woken up,
    189                                         // count will be zeroed
    190     B_RELEASE_IF_WAITING_ONLY   = 0x10  // release count only if there are any
    191                                         // threads waiting
     187    B_DO_NOT_RESCHEDULE         = 0x02, /* thread is not rescheduled */
     188    B_RELEASE_ALL               = 0x08, /* all waiting threads will be woken up,
     189                                           count will be zeroed */
     190    B_RELEASE_IF_WAITING_ONLY   = 0x10  /* release count only if there are any
     191                                           threads waiting */
    192192};
    193193
    194194extern sem_id   create_sem(int32 count, const char *name);
     
    197197extern status_t acquire_sem_etc(sem_id id, int32 count, uint32 flags, bigtime_t timeout);
    198198extern status_t release_sem(sem_id id);
    199199extern status_t release_sem_etc(sem_id id, int32 count, uint32 flags);
    200 // ToDo: the following two calls are not part of the BeOS API, and might be
    201 //  changed or even removed for the final release of Haiku R1
     200/* ToDo: the following two calls are not part of the BeOS API, and might be
     201   changed or even removed for the final release of Haiku R1 */
    202202extern status_t switch_sem(sem_id semToBeReleased, sem_id id);
    203203extern status_t switch_sem_etc(sem_id semToBeReleased, sem_id id, int32 count,
    204204                    uint32 flags, bigtime_t timeout);
     
    382382*/
    383383extern int disable_debugger(int state);
    384384
    385 // TODO: Remove. Temporary debug helper.
     385/* TODO: Remove. Temporary debug helper. */
    386386extern void debug_printf(const char *format, ...)
    387387    __attribute__ ((format (__printf__, 1, 2)));
    388388extern void debug_vprintf(const char *format, va_list args);
     
    410410#define OBOS_CPU_TYPES
    411411
    412412typedef enum cpu_types {
    413     // ToDo: add latest models
     413    /* ToDo: add latest models */
    414414
    415415    /* Motorola/IBM */
    416416    B_CPU_PPC_UNKNOWN                   = 0,
     
    708708extern double   is_computer_on_fire(void);
    709709
    710710
    711 // WARNING: Experimental API!
     711/* WARNING: Experimental API! */
    712712
    713713enum {
    714714    B_OBJECT_TYPE_FD        = 0,
     
    718718};
    719719
    720720enum {
    721     B_EVENT_READ                = 0x0001,   // FD/port readable
    722     B_EVENT_WRITE               = 0x0002,   // FD/port writable
    723     B_EVENT_ERROR               = 0x0004,   // FD error
    724     B_EVENT_PRIORITY_READ       = 0x0008,   // FD priority readable
    725     B_EVENT_PRIORITY_WRITE      = 0x0010,   // FD priority writable
    726     B_EVENT_HIGH_PRIORITY_READ  = 0x0020,   // FD high priority readable
    727     B_EVENT_HIGH_PRIORITY_WRITE = 0x0040,   // FD high priority writable
    728     B_EVENT_DISCONNECTED        = 0x0080,   // FD disconnected
     721    B_EVENT_READ                = 0x0001,   /* FD/port readable */
     722    B_EVENT_WRITE               = 0x0002,   /* FD/port writable */
     723    B_EVENT_ERROR               = 0x0004,   /* FD error */
     724    B_EVENT_PRIORITY_READ       = 0x0008,   /* FD priority readable */
     725    B_EVENT_PRIORITY_WRITE      = 0x0010,   /* FD priority writable */
     726    B_EVENT_HIGH_PRIORITY_READ  = 0x0020,   /* FD high priority readable */
     727    B_EVENT_HIGH_PRIORITY_WRITE = 0x0040,   /* FD high priority writable */
     728    B_EVENT_DISCONNECTED        = 0x0080,   /* FD disconnected */
    729729
    730     B_EVENT_ACQUIRE_SEMAPHORE   = 0x0001,   // semaphore can be acquired
     730    B_EVENT_ACQUIRE_SEMAPHORE   = 0x0001,   /* semaphore can be acquired */
    731731
    732     B_EVENT_INVALID             = 0x1000    // FD/port/sem/thread ID not or
    733                                             // no longer valid (e.g. has been
    734                                             // close/deleted)
     732    B_EVENT_INVALID             = 0x1000    /* FD/port/sem/thread ID not or
     733                                              no longer valid (e.g. has been
     734                                               close/deleted) */
    735735};
    736736
    737737typedef struct object_wait_info {
    738     int32       object;                     // ID of the object
    739     uint16      type;                       // type of the object
    740     uint16      events;                     // events mask
     738    int32       object;                     /* ID of the object */
     739    uint16      type;                       /* type of the object */
     740    uint16      events;                     /* events mask */
    741741} object_wait_info;
    742742
    743 // wait_for_objects[_etc]() waits until at least one of the specified events or,
    744 // if given, the timeout occurred. When entering the function the
    745 // object_wait_info::events field specifies the events for each object the
    746 // caller is interested in. When the function returns the fields reflect the
    747 // events that actually occurred. The events B_EVENT_INVALID, B_EVENT_ERROR,
    748 // and B_EVENT_DISCONNECTED don't need to be specified. They will always be
    749 // reported, when they occur.
     743/* wait_for_objects[_etc]() waits until at least one of the specified events or,
     744  if given, the timeout occurred. When entering the function the
     745  object_wait_info::events field specifies the events for each object the
     746  caller is interested in. When the function returns the fields reflect the
     747  events that actually occurred. The events B_EVENT_INVALID, B_EVENT_ERROR,
     748  and B_EVENT_DISCONNECTED don't need to be specified. They will always be
     749   reported, when they occur. */
    750750
    751751extern ssize_t  wait_for_objects(object_wait_info* infos, int numInfos);
    752752extern ssize_t  wait_for_objects_etc(object_wait_info* infos, int numInfos,
  • storage/FindDirectory.h

     
    1010
    1111
    1212typedef enum {
    13     // Per volume directories
     13    /* Per volume directories */
    1414    B_DESKTOP_DIRECTORY             = 0,
    1515    B_TRASH_DIRECTORY,
    1616
    17     // System directories
     17    /* System directories */
    1818    B_BEOS_DIRECTORY                = 1000,
    1919    B_BEOS_SYSTEM_DIRECTORY,
    2020    B_BEOS_ADDONS_DIRECTORY,
     
    3232    B_BEOS_SOUNDS_DIRECTORY,
    3333    B_BEOS_DATA_DIRECTORY,
    3434
    35     // Common directories, shared among all users.
     35    /* Common directories, shared among all users. */
    3636    B_COMMON_DIRECTORY              = 2000,
    3737    B_COMMON_SYSTEM_DIRECTORY,
    3838    B_COMMON_ADDONS_DIRECTORY,
     
    5555    B_COMMON_DATA_DIRECTORY,
    5656
    5757
    58     // User directories. These are interpreted in the context
    59     // of the user making the find_directory call.
     58    /* User directories. These are interpreted in the context
     59       of the user making the find_directory call. */
    6060    B_USER_DIRECTORY                = 3000,
    6161    B_USER_CONFIG_DIRECTORY,
    6262    B_USER_ADDONS_DIRECTORY,
     
    7272    B_USER_DATA_DIRECTORY,
    7373    B_USER_CACHE_DIRECTORY,
    7474
    75     // Global directories.
     75    /* Global directories. */
    7676    B_APPS_DIRECTORY                = 4000,
    7777    B_PREFERENCES_DIRECTORY,
    7878    B_UTILITIES_DIRECTORY
     
    8383extern "C" {
    8484#endif
    8585
    86 // C interface
     86/* C interface */
    8787
    8888status_t find_directory(directory_which which, dev_t volume, bool createIt,
    8989    char* pathString, int32 length);
     
    9191#ifdef __cplusplus
    9292}
    9393
    94 // C++ interface
     94/* C++ interface */
    9595
    9696class BVolume;
    9797class BPath;
     
    9999status_t find_directory(directory_which which, BPath* path,
    100100    bool createIt = false, BVolume* volume = NULL);
    101101
    102 #endif  // __cplusplus
     102#endif  /* __cplusplus */
    103103
    104 #endif  // _FIND_DIRECTORY_H
     104#endif  /* _FIND_DIRECTORY_H */
  • storage/Mime.h

     
    1919    B_MINI_ICON     = 16
    2020};
    2121
    22 // values for the "force" parameter of update_mime_info() (Haiku only)
     22/* values for the "force" parameter of update_mime_info() (Haiku only) */
    2323enum {
    2424    B_UPDATE_MIME_INFO_NO_FORCE         = 0,
    2525    B_UPDATE_MIME_INFO_FORCE_KEEP_TYPE  = 1,
     
    2727};
    2828
    2929
    30 // C functions
     30/* C functions */
    3131
    3232#ifdef __cplusplus
    3333extern "C" {
     
    4242#ifdef __cplusplus
    4343}
    4444
    45 // C++ functions, Haiku only!
     45/* C++ functions, Haiku only! */
    4646
    4747class BBitmap;
    4848
     
    5454status_t get_named_icon(const char* name, uint8** _data, size_t* _size,
    5555    type_code* _type);
    5656
    57 // include MimeType.h for convenience
     57/* include MimeType.h for convenience */
    5858#   include <MimeType.h>
    59 #endif  // __cplusplus
     59#endif  /* __cplusplus */
    6060
    61 #endif  // _MIME_H
     61#endif  /* _MIME_H */
  • support/ByteOrder.h

     
    1010#include <endian.h>
    1111#include <SupportDefs.h>
    1212#include <TypeConstants.h>
    13     // for convenience
     13    /* for convenience */
    1414
    1515
    16 // swap directions
     16/* swap directions */
    1717typedef enum {
    1818    B_SWAP_HOST_TO_LENDIAN,
    1919    B_SWAP_HOST_TO_BENDIAN,
     
    2323} swap_action;
    2424
    2525
    26 // BSD/networking macros
     26/* BSD/networking macros */
    2727#ifndef htonl
    2828#   define htonl(x) B_HOST_TO_BENDIAN_INT32(x)
    2929#   define ntohl(x) B_BENDIAN_TO_HOST_INT32(x)
     
    3131#   define ntohs(x) B_BENDIAN_TO_HOST_INT16(x)
    3232#endif
    3333
    34 // always swap macros
     34/* always swap macros */
    3535#define B_SWAP_DOUBLE(arg)   __swap_double(arg)
    3636#define B_SWAP_FLOAT(arg)    __swap_float(arg)
    3737#define B_SWAP_INT64(arg)    __swap_int64(arg)
     
    3939#define B_SWAP_INT16(arg)    __swap_int16(arg)
    4040
    4141#if BYTE_ORDER == __LITTLE_ENDIAN
    42 // Host is little endian
     42/* Host is little endian */
    4343
    4444#define B_HOST_IS_LENDIAN 1
    4545#define B_HOST_IS_BENDIAN 0
    4646
    47 // Host native to little endian
     47/* Host native to little endian */
    4848#define B_HOST_TO_LENDIAN_DOUBLE(arg)   (double)(arg)
    4949#define B_HOST_TO_LENDIAN_FLOAT(arg)    (float)(arg)
    5050#define B_HOST_TO_LENDIAN_INT64(arg)    (uint64)(arg)
    5151#define B_HOST_TO_LENDIAN_INT32(arg)    (uint32)(arg)
    5252#define B_HOST_TO_LENDIAN_INT16(arg)    (uint16)(arg)
    5353
    54 // Little endian to host native
     54/* Little endian to host native */
    5555#define B_LENDIAN_TO_HOST_DOUBLE(arg)   (double)(arg)
    5656#define B_LENDIAN_TO_HOST_FLOAT(arg)    (float)(arg)
    5757#define B_LENDIAN_TO_HOST_INT64(arg)    (uint64)(arg)
    5858#define B_LENDIAN_TO_HOST_INT32(arg)    (uint32)(arg)
    5959#define B_LENDIAN_TO_HOST_INT16(arg)    (uint16)(arg)
    6060
    61 // Host native to big endian
     61/* Host native to big endian */
    6262#define B_HOST_TO_BENDIAN_DOUBLE(arg)   __swap_double(arg)
    6363#define B_HOST_TO_BENDIAN_FLOAT(arg)    __swap_float(arg)
    6464#define B_HOST_TO_BENDIAN_INT64(arg)    __swap_int64(arg)
    6565#define B_HOST_TO_BENDIAN_INT32(arg)    __swap_int32(arg)
    6666#define B_HOST_TO_BENDIAN_INT16(arg)    __swap_int16(arg)
    6767
    68 // Big endian to host native
     68/* Big endian to host native */
    6969#define B_BENDIAN_TO_HOST_DOUBLE(arg)   __swap_double(arg)
    7070#define B_BENDIAN_TO_HOST_FLOAT(arg)    __swap_float(arg)
    7171#define B_BENDIAN_TO_HOST_INT64(arg)    __swap_int64(arg)
    7272#define B_BENDIAN_TO_HOST_INT32(arg)    __swap_int32(arg)
    7373#define B_BENDIAN_TO_HOST_INT16(arg)    __swap_int16(arg)
    7474
    75 #else   // BYTE_ORDER
    76 // Host is big endian
     75#else   /* BYTE_ORDER */
     76/* Host is big endian */
    7777
    7878#define B_HOST_IS_LENDIAN 0
    7979#define B_HOST_IS_BENDIAN 1
    8080
    81 // Host native to little endian
     81/* Host native to little endian */
    8282#define B_HOST_TO_LENDIAN_DOUBLE(arg)   __swap_double(arg)
    8383#define B_HOST_TO_LENDIAN_FLOAT(arg)    __swap_float(arg)
    8484#define B_HOST_TO_LENDIAN_INT64(arg)    __swap_int64(arg)
    8585#define B_HOST_TO_LENDIAN_INT32(arg)    __swap_int32(arg)
    8686#define B_HOST_TO_LENDIAN_INT16(arg)    __swap_int16(arg)
    8787
    88 // Little endian to host native
     88/* Little endian to host native */
    8989#define B_LENDIAN_TO_HOST_DOUBLE(arg)   __swap_double(arg)
    9090#define B_LENDIAN_TO_HOST_FLOAT(arg)    __swap_float(arg)
    9191#define B_LENDIAN_TO_HOST_INT64(arg)    __swap_int64(arg)
    9292#define B_LENDIAN_TO_HOST_INT32(arg)    __swap_int32(arg)
    9393#define B_LENDIAN_TO_HOST_INT16(arg)    __swap_int16(arg)
    9494
    95 // Host native to big endian
     95/* Host native to big endian */
    9696#define B_HOST_TO_BENDIAN_DOUBLE(arg)   (double)(arg)
    9797#define B_HOST_TO_BENDIAN_FLOAT(arg)    (float)(arg)
    9898#define B_HOST_TO_BENDIAN_INT64(arg)    (uint64)(arg)
    9999#define B_HOST_TO_BENDIAN_INT32(arg)    (uint32)(arg)
    100100#define B_HOST_TO_BENDIAN_INT16(arg)    (uint16)(arg)
    101101
    102 // Big endian to host native
     102/* Big endian to host native */
    103103#define B_BENDIAN_TO_HOST_DOUBLE(arg)   (double)(arg)
    104104#define B_BENDIAN_TO_HOST_FLOAT(arg)    (float)(arg)
    105105#define B_BENDIAN_TO_HOST_INT64(arg)    (uint64)(arg)
    106106#define B_BENDIAN_TO_HOST_INT32(arg)    (uint32)(arg)
    107107#define B_BENDIAN_TO_HOST_INT16(arg)    (uint16)(arg)
    108108
    109 #endif  // BYTE_ORDER
     109#endif  /* BYTE_ORDER */
    110110
    111111
    112112#ifdef __cplusplus
     
    118118extern bool is_type_swapped(type_code type);
    119119
    120120
    121 // Private implementations
     121/* Private implementations */
    122122extern double __swap_double(double arg);
    123123extern float  __swap_float(float arg);
    124124extern uint64 __swap_int64(uint64 arg);
     
    129129}
    130130#endif
    131131
    132 #endif  // _BYTEORDER_H
     132#endif  /* _BYTEORDER_H */
  • support/SupportDefs.h

     
    2222#include <sys/types.h>
    2323
    2424
    25 // Shorthand type formats
     25/* Shorthand type formats */
    2626typedef signed char             int8;
    2727typedef unsigned char           uint8;
    2828typedef volatile signed char    vint8;
     
    5757typedef unsigned short          unichar;
    5858
    5959
    60 // Descriptive formats
     60/* Descriptive formats */
    6161typedef int32                   status_t;
    6262typedef int64                   bigtime_t;
    6363typedef uint32                  type_code;
    6464typedef uint32                  perform_code;
    6565
    6666
    67 // Empty string ("")
     67/* Empty string ("") */
    6868#ifdef __cplusplus
    6969extern const char *B_EMPTY_STRING;
    7070#endif
    7171
    7272
    73 // min and max comparisons
     73/* min and max comparisons */
    7474#ifndef __cplusplus
    7575#   ifndef min
    7676#       define min(a,b) ((a)>(b)?(b):(a))
     
    8080#   endif
    8181#endif
    8282
    83 // min() and max() won't work in C++
     83/* min() and max() won't work in C++ */
    8484#define min_c(a,b) ((a)>(b)?(b):(a))
    8585#define max_c(a,b) ((a)>(b)?(a):(b))
    8686
    8787
    88 // Grandfathering
     88/* Grandfathering */
    8989#ifndef __cplusplus
    9090#   include <stdbool.h>
    9191#endif
     
    9999extern "C" {
    100100#endif
    101101
    102 // Atomic functions; previous value is returned
     102/* Atomic functions; previous value is returned */
    103103extern int32    atomic_set(vint32 *value, int32 newValue);
    104104extern int32    atomic_test_and_set(vint32 *value, int32 newValue, int32 testAgainst);
    105105extern int32    atomic_add(vint32 *value, int32 addValue);
     
    114114extern int64    atomic_or64(vint64 *value, int64 orValue); 
    115115extern int64    atomic_get64(vint64 *value);
    116116
    117 // Other stuff
     117/* Other stuff */
    118118extern void*    get_stack_frame(void);
    119119
    120120#ifdef __cplusplus
    121121}
    122122#endif
    123123
    124 // Obsolete or discouraged API
     124/* Obsolete or discouraged API */
    125125
    126 // use 'true' and 'false'
     126/* use 'true' and 'false' */
    127127#ifndef FALSE
    128128#   define FALSE    0
    129129#endif
     
    131131#   define TRUE     1
    132132#endif
    133133
    134 #endif  // _SUPPORT_DEFS_H
     134#endif  /* _SUPPORT_DEFS_H */