Last change
on this file since bc11fc1 was 7258c6a, checked in by Thomas Lopatic <thomas@…>, 8 years ago |
Use standard integer types.
|
-
Property mode
set to
100644
|
File size:
770 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 |
|
---|
| 8 | #include "stdio.h"
|
---|
| 9 |
|
---|
[7258c6a] | 10 | extern int16_t getc(FILE *ptr);
|
---|
[f40a309] | 11 |
|
---|
| 12 | /*
|
---|
| 13 | =============================================================================
|
---|
| 14 | getw(stream) -- get a word from 'stream'
|
---|
| 15 |
|
---|
| 16 | Reads a word from 'stream' in Motorola 68000 byte order.
|
---|
| 17 | No special alignment is assumed in the file.
|
---|
| 18 | =============================================================================
|
---|
| 19 | */
|
---|
| 20 |
|
---|
[7258c6a] | 21 | int16_t getw(FILE *stream)
|
---|
[f40a309] | 22 | {
|
---|
[7258c6a] | 23 | int16_t temp;
|
---|
| 24 | register int8_t *t;
|
---|
[f40a309] | 25 |
|
---|
| 26 | t = &temp;
|
---|
| 27 |
|
---|
| 28 | *t++ = fgetc(stream);
|
---|
| 29 | *t = fgetc(stream);
|
---|
| 30 |
|
---|
| 31 | return(temp);
|
---|
| 32 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.