| Last change
 on this file since 8973acd was             8973acd, checked in by Thomas Lopatic <thomas@…>, 8 years ago | 
        
          | 
No more warnings in libcio.
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            762 bytes | 
      
      
| Rev | Line |  | 
|---|
| [f40a309] | 1 | /* | 
|---|
|  | 2 | ============================================================================= | 
|---|
|  | 3 | getw.c -- get a 68000 word from a stream file | 
|---|
|  | 4 | Version 2 -- 1987-10-15 -- D.N. Lynx Crowe | 
|---|
|  | 5 | ============================================================================= | 
|---|
|  | 6 | */ | 
|---|
|  | 7 |  | 
|---|
| [b28a12e] | 8 | #include "ram.h" | 
|---|
| [f40a309] | 9 |  | 
|---|
|  | 10 | /* | 
|---|
|  | 11 | ============================================================================= | 
|---|
|  | 12 | getw(stream) -- get a word from 'stream' | 
|---|
|  | 13 |  | 
|---|
|  | 14 | Reads a word from 'stream' in Motorola 68000 byte order. | 
|---|
|  | 15 | No special alignment is assumed in the file. | 
|---|
|  | 16 | ============================================================================= | 
|---|
|  | 17 | */ | 
|---|
|  | 18 |  | 
|---|
| [7258c6a] | 19 | int16_t getw(FILE *stream) | 
|---|
| [f40a309] | 20 | { | 
|---|
| [7258c6a] | 21 | int16_t temp; | 
|---|
|  | 22 | register int8_t *t; | 
|---|
| [f40a309] | 23 |  | 
|---|
| [8973acd] | 24 | t = (int8_t *)&temp; | 
|---|
| [f40a309] | 25 |  | 
|---|
| [8973acd] | 26 | *t++ = (int8_t)fgetc(stream); | 
|---|
|  | 27 | *t = (int8_t)fgetc(stream); | 
|---|
| [f40a309] | 28 |  | 
|---|
|  | 29 | return(temp); | 
|---|
|  | 30 | } | 
|---|
| [6262b5c] | 31 |  | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.