Removing leading __ from Monicelli type definitions.

This commit is contained in:
Stefano Sanfilippo 2015-03-08 21:37:29 +01:00
parent 711f693f55
commit 04cd095e41
2 changed files with 33 additions and 33 deletions

View File

@ -24,66 +24,66 @@
#include <cassert> #include <cassert>
void __Monicelli_putBool(__Monicelli_Bool value) { void Monicelli_putBool(Monicelli_Bool value) {
puts(value? "vero\n": "falso\n"); puts(value? "vero\n": "falso\n");
} }
void __Monicelli_putChar(__Monicelli_Char value) { void Monicelli_putChar(Monicelli_Char value) {
printf("%c", value); printf("%c", value);
} }
void __Monicelli_putInt(__Monicelli_Int value) { void Monicelli_putInt(Monicelli_Int value) {
printf("%ld\n", value); printf("%ld\n", value);
} }
void __Monicelli_putFloat(__Monicelli_Float value) { void Monicelli_putFloat(Monicelli_Float value) {
printf("%g\n", value); printf("%g\n", value);
} }
void __Monicelli_putDouble(__Monicelli_Double value) { void Monicelli_putDouble(Monicelli_Double value) {
printf("%lg\n", value); printf("%lg\n", value);
} }
__Monicelli_Bool __Monicelli_getBool() { Monicelli_Bool Monicelli_getBool() {
__Monicelli_Bool tmp; Monicelli_Bool tmp;
printf("%s", "? "); printf("%s", "? ");
scanf("%c", &tmp); scanf("%c", &tmp);
return tmp != 0? 1: 0; return tmp != 0? 1: 0;
} }
__Monicelli_Char __Monicelli_getChar() { Monicelli_Char Monicelli_getChar() {
__Monicelli_Char tmp; Monicelli_Char tmp;
printf("%s", "? "); printf("%s", "? ");
scanf("%c", &tmp); scanf("%c", &tmp);
return tmp; return tmp;
} }
__Monicelli_Int __Monicelli_getInt() { Monicelli_Int Monicelli_getInt() {
__Monicelli_Int tmp; Monicelli_Int tmp;
printf("%s", "? "); printf("%s", "? ");
scanf("%ld", &tmp); scanf("%ld", &tmp);
return tmp; return tmp;
} }
__Monicelli_Float __Monicelli_getFloat() { Monicelli_Float Monicelli_getFloat() {
__Monicelli_Float tmp; Monicelli_Float tmp;
printf("%s", "? "); printf("%s", "? ");
scanf("%f", &tmp); scanf("%f", &tmp);
return tmp; return tmp;
} }
__Monicelli_Double __Monicelli_getDouble() { Monicelli_Double Monicelli_getDouble() {
__Monicelli_Double tmp; Monicelli_Double tmp;
printf("%s", "? "); printf("%s", "? ");
scanf("%lf", &tmp); scanf("%lf", &tmp);
return tmp; return tmp;
} }
void __Monicelli_abort() { void Monicelli_abort() {
abort(); abort();
} }
void __Monicelli_assert(__Monicelli_Bool condition) { void Monicelli_assert(Monicelli_Bool condition) {
assert(condition); assert(condition);
} }

View File

@ -22,31 +22,31 @@
#include <stdint.h> #include <stdint.h>
typedef int8_t __Monicelli_Bool; typedef int8_t Monicelli_Bool;
typedef int8_t __Monicelli_Char; typedef int8_t Monicelli_Char;
typedef int64_t __Monicelli_Int; typedef int64_t Monicelli_Int;
typedef float __Monicelli_Float; typedef float Monicelli_Float;
typedef double __Monicelli_Double; typedef double Monicelli_Double;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void __Monicelli_putBool(__Monicelli_Bool value); void __Monicelli_putBool(Monicelli_Bool value);
void __Monicelli_putChar(__Monicelli_Char value); void __Monicelli_putChar(Monicelli_Char value);
void __Monicelli_putInt(__Monicelli_Int value); void __Monicelli_putInt(Monicelli_Int value);
void __Monicelli_putFloat(__Monicelli_Float value); void __Monicelli_putFloat(Monicelli_Float value);
void __Monicelli_putDouble(__Monicelli_Double value); void __Monicelli_putDouble(Monicelli_Double value);
__Monicelli_Bool __Monicelli_getBool(); Monicelli_Bool __Monicelli_getBool();
__Monicelli_Char __Monicelli_getChar(); Monicelli_Char __Monicelli_getChar();
__Monicelli_Int __Monicelli_getInt(); Monicelli_Int __Monicelli_getInt();
__Monicelli_Float __Monicelli_getFloat(); Monicelli_Float __Monicelli_getFloat();
__Monicelli_Double __Monicelli_getDouble(); Monicelli_Double __Monicelli_getDouble();
void __Monicelli_abort(); void __Monicelli_abort();
void __Monicelli_assert(__Monicelli_Bool condition); void __Monicelli_assert(Monicelli_Bool condition);
#ifdef __cplusplus #ifdef __cplusplus
} }