tbeu / matio

MATLAB MAT File I/O Library
https://matio.sourceforge.io
BSD 2-Clause "Simplified" License
334 stars 97 forks source link

Sizeof cleanup #86

Closed papadop closed 4 years ago

papadop commented 6 years ago

This is a cleanup of the code which removes the need to check for type sizes in the configure step. It also factorizes some code and probably more readable.

I have not yet suppressed for configure.ac:

My short term goal is to simplify as much as possible matioConfig.h.in so that only defines used for matio remain. This also means that I will separate the defines only needed for snprintf.c in another file (probably my next task).

Tested on a linux 64 bits computer.

Let's see if the builders are happy...

papadop commented 6 years ago

Another nice feature of this patch is that some previously unchecked configuration will now generate a runtime error (I must admit that there is close to zero chance that these cases are met: sizeof pointer different from 4 or 8, or size of a type not covered by char, short, int, long and long long or their unsigned counterparts).

papadop commented 6 years ago

OK some small issues corrected (windows visual C not knowing inline and a typo which was generating a warning which I had not seen).

papadop commented 6 years ago

There is a problem with matioConfig.h.in ... Probably related to some .gitignore issue, because git tells me that the file is not tracked but was obtained when I checked out the repository.... I will correct that. By the way I have several files generated by autoconf/automake which appear in the status. Would it make sense to add them to .gitignore ? My autoconf/automake mastership is not what it was a few years ago, so I may be wrong....

bali-> git status
On branch SIZEOF_cleanup
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   config/config.guess
    modified:   config/config.sub
    deleted:    config/depcomp
    modified:   config/install-sh
    modified:   config/missing

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    config/compile
    src/matioConfig.h.in

no changes added to commit (use "git add" and/or "git commit -a")

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.02%) to 81.174% when pulling 3b52ebe05c824b06c5d305ec345a502e9f2ef49d on papadop:SIZEOF_cleanup into 85141e7e7654c10cde54a3dabdcb7e18d3d02536 on tbeu:master.

tbeu commented 6 years ago

That is what I see on openSUSE Leap 42.3:

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        matio.pc
        src/matio_pubconf.h
        src/stamp-h2
        test/atconfig

nothing added to commit but untracked files present (use "git add" to track)
tbeu commented 4 years ago

Closing now, since there is no more progress to expect.