[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 92aa47: Make SoundCodecPrims LLP64 compatible

GitHub noreply at github.com
Mon Jul 18 16:38:39 UTC 2016


  Branch: refs/heads/Cog
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: 92aa473657f21c24f7c8d897b40c7c771d6e88fd
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/92aa473657f21c24f7c8d897b40c7c771d6e88fd
  Author: Nicolas Cellier <nicolas.cellier at sirehna.com>
  Date:   2016-07-18 (Mon, 18 Jul 2016)

  Changed paths:
    M platforms/Cross/plugins/SoundCodecPrims/SoundCodecPrims.h
    M platforms/Cross/plugins/SoundCodecPrims/sqSoundCodecPluginBasicPrims.c

  Log Message:
  -----------
  Make SoundCodecPrims LLP64 compatible

Pass squeak types (usqIntptr_t and sqInt) exclusively to API functions (gsmDecode, gsmEncode, gsmInitState, gsmStateBytes).
Avoid long which is too short for passing a pointer on LLP64.


  Commit: aa1d7a975ce8199fc0ff6e6dd8381fbc67a3689f
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aa1d7a975ce8199fc0ff6e6dd8381fbc67a3689f
  Author: Nicolas Cellier <nicolas.cellier at sirehna.com>
  Date:   2016-07-18 (Mon, 18 Jul 2016)

  Changed paths:
    M platforms/win32/plugins/SoundPlugin/sqWin32Sound.c

  Log Message:
  -----------
  Fix two compiler warnings in Win32 sound plugin support.

The first one is benign:

../../platforms/win32/plugins/SoundPlugin/sqWin32Sound.c:76:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^

The second one is more suspicious: we assign twice the variable in the same instruction, which is problematic...
We could have replaced by playBufferIndex = (playBufferIndex+1) & 1;
But we use the xor instead as we now that the variable is already 0 or 1.

../../platforms/win32/plugins/SoundPlugin/sqWin32Sound.c:116:25: warning: multiple unsequenced modifications to 'playBufferIndex' [-Wunsequenced]
      playBufferIndex = ++playBufferIndex & 1;
                ~ ^
../../platforms/win32/plugins/SoundPlugin/sqWin32Sound.c:127:24: warning: multiple unsequenced modifications to 'recBufferIndex' [-Wunsequenced]
      recBufferIndex = ++recBufferIndex & 1;
               ~ ^


Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/a519d1f44594...aa1d7a975ce8


More information about the Vm-dev mailing list