Get unsigned 16-bit integer from stdin in hex. */
| 42 | |
| 43 | /* Get unsigned 16-bit integer from stdin in hex. */ |
| 44 | static uint32 GetH16(unsigned int def) |
| 45 | { |
| 46 | char buf[32]; |
| 47 | |
| 48 | if ( fgets(buf,ARRAY_SIZE(buf),stdin) == nullptr ) |
| 49 | { |
| 50 | return def; |
| 51 | } |
| 52 | if(buf[0]=='\n') |
| 53 | return(def); |
| 54 | if(buf[0]=='$') |
| 55 | sscanf(buf+1,"%04x",&def); |
| 56 | else |
| 57 | sscanf(buf,"%04x",&def); |
| 58 | return def; |
| 59 | } |
| 60 | |
| 61 | /* Get unsigned 8-bit integer from stdin in decimal. */ |
| 62 | static uint8 Get8(unsigned int def) |
no outgoing calls
no test coverage detected