Changeset 7258c6a in buchla-68k for libcio/putc.c
- Timestamp:
- 07/09/2017 04:45:34 PM (7 years ago)
- Branches:
- master
- Children:
- 8618599
- Parents:
- 0292fbb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcio/putc.c
r0292fbb r7258c6a 9 9 #include "stddefs.h" 10 10 11 extern int write(int fd, char *buff, unsignedlen);11 extern int16_t write(int16_t fd, int8_t *buff, uint16_t len); 12 12 extern void getbuff(FILE *ptr); 13 extern int close(int fd);13 extern int16_t close(int16_t fd); 14 14 15 extern int (*_clsall)();15 extern int16_t (*_clsall)(); 16 16 17 static int (*cls_rtn)();17 static int16_t (*cls_rtn)(); 18 18 19 int _ClFlag;19 int16_t _ClFlag; 20 20 21 int fclose(FILE *ptr);21 int16_t fclose(FILE *ptr); 22 22 23 23 /* … … 47 47 */ 48 48 49 int flush_(FILE *ptr, int data)49 int16_t flush_(FILE *ptr, int16_t data) 50 50 { 51 register int size;51 register int16_t size; 52 52 53 53 if (_ClFlag EQ 0) { … … 60 60 if (ptr->_flags & _DIRTY) { /* something in the buffer ? */ 61 61 62 size = (int )((long)ptr->_bp - (long)ptr->_buff);62 size = (int16_t)((int32_t)ptr->_bp - (int32_t)ptr->_buff); 63 63 64 64 if (write(ptr->_unit, ptr->_buff, size) EQ -1) { … … 105 105 */ 106 106 107 int fflush(FILE *ptr)107 int16_t fflush(FILE *ptr) 108 108 { 109 109 return(flush_(ptr, -1)); … … 116 116 */ 117 117 118 int fclose(FILE *ptr)118 int16_t fclose(FILE *ptr) 119 119 { 120 int err;120 int16_t err; 121 121 122 122 err = 0; … … 131 131 if (ptr->_flags & _ALLBUF) { /* deallocate standard buffer */ 132 132 133 *( long**)ptr->_buff = Stdbufs;134 Stdbufs = ( long*)ptr->_buff;133 *(int32_t **)ptr->_buff = Stdbufs; 134 Stdbufs = (int32_t *)ptr->_buff; 135 135 } 136 136 } … … 150 150 */ 151 151 152 int putc(int c, FILE *ptr)152 int16_t putc(int16_t c, FILE *ptr) 153 153 { 154 154 if (ptr->_bp GE ptr->_bend) … … 164 164 */ 165 165 166 int puterr(int c)166 int16_t puterr(int16_t c) 167 167 { 168 168 return(putc(c, stderr));
Note:
See TracChangeset
for help on using the changeset viewer.