git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Use standard ints in runtime
3885660Andy Arvanitis
.gitignore+1
@@ -18,3 +18,4 @@ output
18examples/docs/docs/
18examples/docs/docs/
19core-tests/full-core-docs.md
19core-tests/full-core-docs.md
20.psc-ide-port
20.psc-ide-port
21+.vscode/
runtime/purescript.h+3−6
@@ -21,16 +21,13 @@ namespace purescript {
21 public:
21 public:
22 using std::shared_ptr<void>::shared_ptr;
22 using std::shared_ptr<void>::shared_ptr;
23
23
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)) {
25 }
25 }
26
26
27− boxed(const 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)) {
28− }
29−
30− boxed(const unsigned int n) : std::shared_ptr<void>(std::make_shared<int64_t>(n)) {
31 }
28 }
32
29
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)) {
34 }
31 }
35
32
36 boxed(const char s[]) : std::shared_ptr<void>(std::make_shared<string>(s)) {
33 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'
237 , maybe (return mempty) (fmap (emit " else " <>) . prettyPrintCpp') elses
237 , maybe (return mempty) (fmap (emit " else " <>) . prettyPrintCpp') elses
238 ]
238 ]
239 where
239 where
240− t | Left _ <- n = "int64_t"
240+ t | Left _ <- n = "int"
241 | Right _ <- n = "double"
241 | Right _ <- n = "double"
242
242
243 match (IfElse _ cond thens elses) = mconcat <$> sequence
243 match (IfElse _ cond thens elses) = mconcat <$> sequence
@@ -383,7 +383,7 @@ unboxType :: Text -> Maybe Text
383unboxType t
383unboxType t
384 | t == C.semiringInt ||
384 | t == C.semiringInt ||
385 t == C.ringInt
385 t == C.ringInt
386− = Just "int64_t"
386+ = Just "int"
387 | t == C.semiringNumber ||
387 | t == C.semiringNumber ||
388 t == C.ringNumber ||
388 t == C.ringNumber ||
389 t == C.euclideanRingNumber
389 t == C.euclideanRingNumber