git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Use standard ints in runtime
commit3885660302f3dfcb7e5fe23e5e4d033a45d4b32c authorAndy Arvanitis <andyarvanitis@gmail.com> dateTue 31 Jul 2018, 20:36 (8 years ago) parentb351f82
3 files changed+6−8
.gitignore+1 runtime/purescript.h+3−6 src/CodeGen/Cpp/Printer.hs+2−2
.gitignore+1
@@ -18,3 +18,4 @@ output
1818examples/docs/docs/
1919core-tests/full-core-docs.md
2020.psc-ide-port
21+.vscode/
runtime/purescript.h+3−6
@@ -21,16 +21,13 @@ namespace purescript {
2121 public:
2222 using std::shared_ptr<void>::shared_ptr;
2323
24− boxed(const int64_t n) : std::shared_ptr<void>(std::make_shared<int64_t>(n)) {
24+ boxed(const int n) : std::shared_ptr<void>(std::make_shared<int>(n)) {
2525 }
2626
27− boxed(const int n) : std::shared_ptr<void>(std::make_shared<int64_t>(n)) {
28− }
29−
30− boxed(const unsigned int n) : std::shared_ptr<void>(std::make_shared<int64_t>(n)) {
27+ boxed(const double n) : std::shared_ptr<void>(std::make_shared<double>(n)) {
3128 }
3229
33− boxed(const double n) : std::shared_ptr<void>(std::make_shared<double>(n)) {
30+ boxed(const bool b) : std::shared_ptr<void>(std::make_shared<bool>(b)) {
3431 }
3532
3633 boxed(const char s[]) : std::shared_ptr<void>(std::make_shared<string>(s)) {
src/CodeGen/Cpp/Printer.hs+2−2
@@ -237,7 +237,7 @@ literals = mkPattern' match'
237237 , maybe (return mempty) (fmap (emit " else " <>) . prettyPrintCpp') elses
238238 ]
239239 where
240− t | Left _ <- n = "int64_t"
240+ t | Left _ <- n = "int"
241241 | Right _ <- n = "double"
242242
243243 match (IfElse _ cond thens elses) = mconcat <$> sequence
@@ -383,7 +383,7 @@ unboxType :: Text -> Maybe Text
383383unboxType t
384384 | t == C.semiringInt ||
385385 t == C.ringInt
386− = Just "int64_t"
386+ = Just "int"
387387 | t == C.semiringNumber ||
388388 t == C.ringNumber ||
389389 t == C.euclideanRingNumber