Moshin wrote:
> >> I am able to reproduce the crash on 64bit linux (gcc
> >> x86_64-linux-gnu), the fix is:
> >>
> >> 1 blowfish blocks should always be 32bits: i.e. unsigned int, not
> >> unsigned long.
> >> 2. My BIG_ENDIAN macro usage was incompatible with linux/stdlib, this
> >> was caught by the self test.
> >> 3 The same self test as windows should work on all machines.
> >>
> >> Attaching the unified diffs from blowfish.[ch] vs patch4/blowfish.[ch]
> >
> > I have merged the suggested changes and will push the new version as
> > soon as the repository is open again.
> >
> > Please check again for any remaining problems.
>
> Bram,
>
> Noticed one problem in my macro usage in blowfish.c,
>
> wrong
> < #if defined(BF_BIG_ENDIAN) && (BF_BIG_ENDIAN == 0)
> ---
> fix, should have been
> > #if defined(BF_BIG_ENDIAN) && (BF_BIG_ENDIAN == 1)
>
> If you have a cleaner ENDIAN macros, you can replace this.
I have used the autoconf macro that James Vega suggested.
I assume all MS-Windows compilers use little endian (are there any power
PC users remaining?).
I added an explicit check in the self test for the little/big endian to
be picked wrong.
> Changing all the types to uint32_t seems cleaner, I should
> have used it earlier:
>
> typedef union {
> - unsigned int ul[2];
> - unsigned char uc[8];
> + uint32_t ul[2];
> + uint8_t uc[8];
> } block8;
Already did that. I'm using char_u for the 8 bit type, as this is all
over the Vim source code.
Any other places where these types need to be used?
> Attaching the files again, tested on windows and linux x86-64,
> tested on big endian solaris long back (but not recently).
Please compare to what is now in the Mercurial repository.
--
hundred-and-one symptoms of being an internet addict:
61. Your best friends know your e-mail address, but neither your phone number
nor the address where you live.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php