Code Monkey home page Code Monkey logo

Comments (3)

enh-google avatar enh-google commented on August 24, 2024

no, it's not you... this fixes it:

diff --git a/toys/pending/expr.c b/toys/pending/expr.c
index a236aaab..54ebd14b 100644
--- a/toys/pending/expr.c
+++ b/toys/pending/expr.c
@@ -146,9 +146,8 @@ static struct op_def {
 
 void eval_op(struct op_def *o, struct value *ret, struct value *rhs)
 {
-  long long a, b, x = 0; // x = a OP b for ints.
+  long long cmp, a, b, x = 0; // x = a OP b for ints.
   char *s, *t; // string operands
-  int cmp;
 
   switch (o->sig) {
 

but i think rob's rewriting expr right now anyway?

from toybox.

yarcod avatar yarcod commented on August 24, 2024

Great, thanks!
Does this also solve the issue with the inconsistent return codes? Because I am still not sure what they were caused by.

from toybox.

landley avatar landley commented on August 24, 2024

Commit 251be88 with a test.

As for rewrite, I have a tree with a dirty expr.c in it but it doesn't collapse cleanly into the $(( )) math logic and I find a lot of its string vs not string behavior non-obvious, so I keep waffling over throw it out vs patch what's there vs try not to touch it...

from toybox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.