Changeset 8973acd in buchla-68k for include


Ignore:
Timestamp:
07/15/2017 03:12:10 PM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
ea232f9
Parents:
7d0d347
Message:

No more warnings in libcio.

Location:
include
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • include/biosdefs.h

    r7d0d347 r8973acd  
    6464struct bpb {                    /* BIOS parameter block returned by B_GBPB */
    6565
    66         uint16_t        recsiz;         /* physical sector size in bytes */
    67         uint16_t        clsiz;          /* cluster size in sectors */
    68         uint16_t        clsizb;         /* cluster size in bytes */
    69         uint16_t        rdlen;          /* root directory length in sectors */
    70         uint16_t        fsiz;           /* FAT size in sectors */
    71         uint16_t        fatrec;         /* sector number of 1st sector of 2nd FAT */
    72         uint16_t        datrec;         /* sector number of 1st data sector */
    73         uint16_t        numcl;          /* number of data clusters on disk */
     66        int16_t         recsiz;         /* physical sector size in bytes */
     67        int16_t         clsiz;          /* cluster size in sectors */
     68        int16_t         clsizb;         /* cluster size in bytes */
     69        int16_t         rdlen;          /* root directory length in sectors */
     70        int16_t         fsiz;           /* FAT size in sectors */
     71        int16_t         fatrec;         /* sector number of 1st sector of 2nd FAT */
     72        int16_t         datrec;         /* sector number of 1st data sector */
     73        int16_t         numcl;          /* number of data clusters on disk */
    7474        uint16_t        bflags;         /* flags */
    75         uint16_t        ntracks;        /* number of tracks */
    76         uint16_t        nsides;         /* number of sides (heads) */
    77         uint16_t        dspc;           /* sectors per cylinder */
    78         uint16_t        dspt;           /* sectors per track */
    79         uint16_t        hidden;         /* number of hidden files */
     75        int16_t         ntracks;        /* number of tracks */
     76        int16_t         nsides;         /* number of sides (heads) */
     77        int16_t         dspc;           /* sectors per cylinder */
     78        int16_t         dspt;           /* sectors per track */
     79        int16_t         hidden;         /* number of hidden files */
    8080        int8_t  serno[3];               /* disk serial number */
    8181        int8_t  nada;                   /* --- filler - nothing here --- */
     
    8484#define BPBSIZE 32              /* length of a BPB */
    8585
    86 #define B_FAT16 0x0001          /* flag for using 16 bit FAT entries */
     86#define B_FAT16 0x0001u         /* flag for using 16 bit FAT entries */
    8787
    8888/*
     
    9494struct dirent {                 /* Directory entry */
    9595
    96         int8_t  fname[8];               /* file name */
    97         int8_t  fext[3];                /* file extension */
    98         int8_t  atrib;                  /* attribute byte */
    99         int8_t  unused[10];             /* unused space */
    100         uint16_t        crtime;         /* 'LLHH' creation time */
    101         uint16_t        crdate;         /* 'LLHH' creation date */
    102         uint16_t        bclust;         /* 'LLHH' starting cluster number */
    103         int32_t flen;                   /* 'LLHH' file length */
     96        int8_t  fname[8];       /* file name */
     97        int8_t  fext[3];        /* file extension */
     98        uint8_t atrib;          /* attribute byte */
     99        int8_t  unused[10];     /* unused space */
     100        uint16_t        crtime; /* 'LLHH' creation time */
     101        uint16_t        crdate; /* 'LLHH' creation date */
     102        uint16_t        bclust; /* 'LLHH' starting cluster number */
     103        uint32_t        flen;   /* 'LLHH' file length */
    104104};
    105105
    106106#define DENTSIZE        (sizeof (struct dirent))
    107107
    108 #define F_RDONLY        0x01    /* Read only file */
    109 #define F_HIDDEN        0x02    /* Hidden file */
    110 #define F_SYSTEM        0x04    /* System file */
    111 #define F_VOLUME        0x08    /* Volume label */
    112 #define F_SUBDIR        0x10    /* Sub-directory */
    113 #define F_ARCHIV        0x20    /* Archived */
     108#define F_RDONLY        0x01u   /* Read only file */
     109#define F_HIDDEN        0x02u   /* Hidden file */
     110#define F_SYSTEM        0x04u   /* System file */
     111#define F_VOLUME        0x08u   /* Volume label */
     112#define F_SUBDIR        0x10u   /* Sub-directory */
     113#define F_ARCHIV        0x20u   /* Archived */
    114114
    115115/*
     
    123123        struct  dirent  de;     /* directory entry image for file */
    124124        uint16_t        modefl; /* fcb flags */
    125         uint16_t        clsec;  /* current sector in cluster */
    126         uint16_t        curcls; /* current cluster */
    127         uint16_t        offset; /* current offset into sector */
    128         int32_t curlsn;         /* current logical sector number in file */
    129         int32_t curdsn;         /* current logical sector number on disk */
     125        int16_t clsec;          /* current sector in cluster */
     126        int16_t curcls;         /* current cluster */
     127        int16_t offset;         /* current offset into sector */
     128        int16_t curlsn;         /* current logical sector number in file */
     129        int16_t curdsn;         /* current logical sector number on disk */
    130130        int32_t curlen;         /* current file length in bytes */
    131         int32_t asects;         /* allocated file length in sectors */
     131        int16_t asects;         /* allocated file length in sectors */
    132132};
    133133
    134 #define FC_EOF  0x8000          /* end of file */
    135 #define FC_BAD  0x4000          /* bad FAT entry encountered */
    136 #define FC_ERR  0x2000          /* error encountered */
    137 #define FC_OPN  0x1000          /* file open */
     134#define FC_EOF  0x8000u         /* end of file */
     135#define FC_BAD  0x4000u         /* bad FAT entry encountered */
     136#define FC_ERR  0x2000u         /* error encountered */
     137#define FC_OPN  0x1000u         /* file open */
    138138
    139 #define FC_CR   0x0800          /* create mode */
    140 #define FC_AP   0x0400          /* append mode */
    141 #define FC_WR   0x0200          /* write mode */
    142 #define FC_RD   0x0100          /* read mode */
     139#define FC_CR   0x0800u         /* create mode */
     140#define FC_AP   0x0400u         /* append mode */
     141#define FC_WR   0x0200u         /* write mode */
     142#define FC_RD   0x0100u         /* read mode */
    143143
    144 #define FC_EX   0x0080          /* exclusive mode */
    145 #define FC_TR   0x0040          /* truncate mode */
    146 #define FC_NB   0x0020          /* non-blocking mode */
    147 #define FC_BF   0x0010          /* binary file mode */
     144#define FC_EX   0x0080u         /* exclusive mode */
     145#define FC_TR   0x0040u         /* truncate mode */
     146#define FC_NB   0x0020u         /* non-blocking mode */
     147#define FC_BF   0x0010u         /* binary file mode */
    148148
    149149#define FC_RW   (FC_RD | FC_WR) /* read-write mode */
  • include/fcntl.h

    r7d0d347 r8973acd  
    1515*/
    1616
    17 #define O_RDONLY        0x0000  /* Read-only value  */
    18 #define O_WRONLY        0x0001  /* Write-only value */
    19 #define O_RDWR          0x0002  /* Read-write value */
     17#define O_RDONLY        0x0000u /* Read-only value  */
     18#define O_WRONLY        0x0001u /* Write-only value */
     19#define O_RDWR          0x0002u /* Read-write value */
    2020
    21 #define O_NDELAY        0x0004  /* Non-blocking I/O flag */
    22 #define O_APPEND        0x0008  /* Append mode flag (write only at end) */
     21#define O_NDELAY        0x0004u /* Non-blocking I/O flag */
     22#define O_APPEND        0x0008u /* Append mode flag (write only at end) */
    2323
    24 #define O_CREAT         0x0100  /* File creation flag (uses 3rd argument) */
    25 #define O_TRUNC         0x0200  /* File truncation flag */
    26 #define O_EXCL          0x0400  /* Exclusive access flag */
     24#define O_CREAT         0x0100u /* File creation flag (uses 3rd argument) */
     25#define O_TRUNC         0x0200u /* File truncation flag */
     26#define O_EXCL          0x0400u /* Exclusive access flag */
    2727
    28 #define O_RAW           0x8000  /* Raw (binary) I/O flag for getc and putc */
     28#define O_RAW           0x8000u /* Raw (binary) I/O flag for getc and putc */
    2929
    3030/*
  • include/fspars.h

    r7d0d347 r8973acd  
    2424
    2525#define MAXFAT          7       /* maximum number of fat sectors */
    26 #define WDPSEC          256     /* words per sector */
    2726#define MAXDIRNT        224     /* maximum number of directory entries */
    2827
  • include/io.h

    r7d0d347 r8973acd  
    1515
    1616typedef int16_t (*chclo)(io_arg arg);
    17 typedef int16_t (*devop)(int8_t *name, int16_t flag, int16_t mode, struct channel *chp, struct devtabl *dp);
     17typedef int16_t (*devop)(int8_t *name, uint16_t flag, struct channel *chp, struct devtabl *dp);
    1818
    1919struct channel {                /* channel table entry */
    2020
    21         int8_t  c_read;         /* read routine index */
    22         int8_t  c_write;        /* write routine index */
    23         int8_t  c_ioctl;        /* ioctl routine index */
    24         int8_t  c_seek;         /* seek routine index */
     21        int16_t c_read;         /* read routine index */
     22        int16_t c_write;        /* write routine index */
     23        int16_t c_ioctl;        /* ioctl routine index */
     24        int16_t c_seek;         /* seek routine index */
    2525        chclo   c_close;        /* close function pointer */
    2626        io_arg  c_arg;          /* argument to channel driver */
     
    2929struct device {                 /* device control structure */
    3030
    31         int8_t  d_read;         /* read routine code */
    32         int8_t  d_write;        /* write routine code */
    33         int8_t  d_ioctl;        /* ioctl routine code */
    34         int8_t  d_seek;         /* seek routine code */
     31        int16_t d_read;         /* read routine code */
     32        int16_t d_write;        /* write routine code */
     33        int16_t d_ioctl;        /* ioctl routine code */
     34        int16_t d_seek;         /* seek routine code */
    3535        devop   d_open;         /* special open function */
    3636};
     
    4141        struct  device  *d_dev; /* pointer to device structure */
    4242        io_arg  d_arg;          /* argument to device driver */
     43        int16_t d_kind;         /* kind of device */
    4344};
  • include/stdio.h

    r7d0d347 r8973acd  
    1616#define fputc   putc
    1717
    18 #define _BUSY   0x01
    19 #define _ALLBUF 0x02
    20 #define _DIRTY  0x04
    21 #define _EOF    0x08
    22 #define _IOERR  0x10
     18#define _BUSY   0x01u
     19#define _ALLBUF 0x02u
     20#define _DIRTY  0x04u
     21#define _EOF    0x08u
     22#define _IOERR  0x10u
    2323
    2424typedef struct {
     
    2727        int8_t  *_bend;         /* last character in buffer + 1 */
    2828        int8_t  *_buff;         /* address of buffer */
    29         int8_t  _flags;         /* {_BUSY, _ALLBUF, _DIRTY, _EOF, _IOERR} */
    30         int8_t  _unit;          /* fd token returned by open */
     29        int16_t _unit;          /* fd token returned by open */
     30        uint8_t _flags;         /* {_BUSY, _ALLBUF, _DIRTY, _EOF, _IOERR} */
    3131        int8_t  _bytbuf;        /* single byte buffer for unbuffered streams */
    3232        int8_t  _pad;           /* pad for alignment -- possibly use later */
     
    4545#define clearerr(fp)    ((fp)->_flags &= ~(_IOERR | _EOF))
    4646#define fileno(fp)      ((fp)->_unit)
    47 
    48 #define O_RDONLY        0x0000  /* Read-only value  */
    49 #define O_WRONLY        0x0001  /* Write-only value */
    50 #define O_RDWR          0x0002  /* Read-write value */
    51 
    52 #define O_NDELAY        0x0004  /* Non-blocking I/O flag */
    53 #define O_APPEND        0x0008  /* Append mode flag (write only at end) */
    54 
    55 #define O_CREAT         0x0100  /* File creation flag (uses 3rd argument) */
    56 #define O_TRUNC         0x0200  /* File truncation flag */
    57 #define O_EXCL          0x0400  /* Exclusive access flag */
    58 
    59 #define O_RAW           0x8000  /* Raw (binary) I/O flag for getc and putc */
Note: See TracChangeset for help on using the changeset viewer.