Thread: HyperC

  1. #76
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    338

    Wink

    this belongs on a blog on your own forum
    ok then.

    where people who are actually interested can follow your wandering thoughts.
    Have people ever heard of innovation and integrity ?
    "without goto we would be wtf'd"

  2. #77
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,791
    What happens if the input file doesn't fit into a char array of size 1000000 and why read the entire file into memory?
    Also it would be nice to check that calls to fopen() succeed before reading from the file and then call fclose() after you're finished with it

  3. #78
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    338

    Cool

    What happens if the input file doesn't fit into a char array of size 1000000 and why read the entire file into memory?
    I have not had a problem with the program size yet.
    When importing files i have definitely come across size issues.
    I built it awhile ago and it could use some improvements.

    Also it would be nice to check that calls to fopen() succeed before reading from the file and then call fclose() after you're finished with it
    I thought that i closed anything i opened...
    "without goto we would be wtf'd"

  4. #79
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,791
    Quote Originally Posted by Structure View Post
    I have not had a problem with the program size yet.
    When importing files i have definitely come across size issues.
    I built it awhile ago and it could use some improvements.


    I thought that i closed anything i opened...
    In the function where you read the entire file into a global array, you open a file (without checking that it was actually opened) and then proceed to read the file (using fgets into a 256 char buffer and adding what's read to the global) and when finished not close the file. As far as I can see anyway.

  5. #80
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    338
    Update: v5.1

    call fclose() after you're finished with it
    I closed the file, thank you.
    "without goto we would be wtf'd"

  6. #81
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,791
    When you split things up using strtok, you store the results in global variables. I've tried to think of why this might be a good idea but I can't come up with a good reason. What's the reasoning behind having that kind of stuff as global variables?

  7. #82
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,791
    I think what we'll do when you share the source code is rewrite a lot of this. The functions that trim whitespace seem ok, but main() is way too long. We could split it up a bit I think.

  8. #83
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    338
    What's the reasoning behind having that kind of stuff as global variables?
    I think it is just a habit i have of using globals.

    rewrite a lot of this.
    That is understandable. I still have not gone through and re wrote it myself to make things "better". So that it is not exactly streamlined and sort of messy as i have gone through and changed things.
    "without goto we would be wtf'd"

  9. #84
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    338
    Thank you for taking the time to look at HyperC.
    Any ideas are welcome and appreciated.
    "without goto we would be wtf'd"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. HyperC Pre Process File Injection
    By Structure in forum Tech Board
    Replies: 2
    Last Post: 08-06-2019, 06:13 AM
  2. The future of the C language is HyperC
    By Structure in forum Projects and Job Recruitment
    Replies: 6
    Last Post: 05-14-2019, 08:55 AM

Tags for this Thread