GithubHelp home page GithubHelp logo

Comments (6)

luben avatar luben commented on April 20, 2024

I am not sure it this is the right fix:

diff --git a/programs/fileio.c b/programs/fileio.c
index e84d633..9aa5bf2 100644
--- a/programs/fileio.c
+++ b/programs/fileio.c
@@ -384,7 +384,6 @@ unsigned long long FIO_decompressFilename(const char* output_filename, const cha
     {
         toRead = 0;

-#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT==1)
         {
             size_t sizeCheck;
             /* check magic number -> version */
@@ -392,13 +391,14 @@ unsigned long long FIO_decompressFilename(const char* output_filename, const cha
             sizeCheck = fread(inBuff, (size_t)1, toRead, finput);
             if (sizeCheck==0) break;   /* no more input */
             if (sizeCheck != toRead) EXM_THROW(31, "Read error : cannot read header");
+#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT==1)
             if (ZSTD_isLegacy(MEM_readLE32(inBuff)))
             {
                 filesize += FIO_decompressLegacyFrame(foutput, finput, MEM_readLE32(inBuff));
                 continue;
             }
-        }
 #endif   /* ZSTD_LEGACY_SUPPORT */
+        }

         filesize += FIO_decompressFrame(foutput, finput, inBuff, inBuffSize, toRead, outBuff, outBuffSize, dctx);
     }

from zstd.

Cyan4973 avatar Cyan4973 commented on April 20, 2024

Thanks for notification @luben .

Indeed, this is a path I haven't thoroughly tested.
I should add relevant tests in CI suite, to make sure it's correctly tracked.

Your patch looks good to me. I believe it's the correct fix.

from zstd.

Cyan4973 avatar Cyan4973 commented on April 20, 2024

Hopefully fixed in latest "dev" branch update

from zstd.

Cyan4973 avatar Cyan4973 commented on April 20, 2024

Btw, I've got a question regarding no-legacy builds.

Currently, building with no-legacy is triggered using ZSTD_LEGACY=disable .

In the source code, it is done with #define ZSTD_LEGACY_SUPPORT 0

Thus, they are a little bit different.
I'm wondering if it would be better to follow a single convention, such as ZSTD_LEGACY_SUPPORT=0 for both.

from zstd.

luben avatar luben commented on April 20, 2024

Yes, makes sense. I was looking in the Makefiles for find what I have to pass in order to disable it after first trying with ZSTD_LEGACY_SUPPORT=0

from zstd.

Cyan4973 avatar Cyan4973 commented on April 20, 2024

Parameter changed to ZSTD_LEGACY_SUPPORT=0 within latest dev branch.

from zstd.

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.