VM Maker: VMMaker.oscog-eem.2218.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: VMMaker.oscog-eem.2218.mcz

commits-2
 
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2218.mcz

==================== Summary ====================

Name: VMMaker.oscog-eem.2218
Author: eem
Time: 19 May 2017, 12:36:25.817418 pm
UUID: eab4416b-cf0c-4615-ad66-e6d0990d6295
Ancestors: VMMaker.oscog-eem.2217

Fix slips in the SoundPlugin code.

=============== Diff against VMMaker.oscog-eem.2217 ===============

Item was changed:
  ----- Method: SoundPlugin>>primitiveSetDefaultSoundPlayer (in category 'primitives') -----
  primitiveSetDefaultSoundPlayer
  "Tell the operating system to use the specified device name as the output device for sound."
  "arg at top of stack is the String"
  | deviceName obj srcPtr sz |
  <export: true>
  <var: 'deviceName' declareC: 'char deviceName[257]'>
  <var: 'srcPtr' type: #'char *'>
 
  "Parse arguments"
  interpreterProxy methodArgumentCount = 1 ifFalse:
  [^interpreterProxy primitiveFail].
  obj := interpreterProxy stackValue: 0.
  (interpreterProxy isBytes: obj) ifFalse:
  [^interpreterProxy primitiveFail].
  (sz := interpreterProxy byteSizeOf: obj) <= 256 ifFalse:
  [^interpreterProxy primitiveFail].
  srcPtr := interpreterProxy firstIndexableField: obj.
  self touch: srcPtr.
  self touch: deviceName.
  self touch: sz.
  self cCode: 'strncpy(deviceName, srcPtr, sz)'.
  self cCode: 'deviceName[sz] = NULL'.
 
  "do the work"
  self cCode: 'setDefaultSoundPlayer(deviceName)'.
+ interpreterProxy failed ifFalse: "pop arg, leave receiver"
- self success ifTrue: "pop arg, leave receiver"
  [interpreterProxy pop: 1]!

Item was changed:
  ----- Method: SoundPlugin>>primitiveSetDefaultSoundRecorder (in category 'primitives') -----
  primitiveSetDefaultSoundRecorder
  "Tell the operating system to use the specified device name as the input device for sound."
  "arg at top of stack is the String"
  | deviceName obj srcPtr sz |
  <export: true>
  <var: 'deviceName' declareC: 'char deviceName[257]'>
  <var: 'srcPtr' type: #'char *'>
 
  "Parse arguments"
  interpreterProxy methodArgumentCount = 1 ifFalse:
  [^interpreterProxy primitiveFail].
  obj := interpreterProxy stackValue: 0.
  (interpreterProxy isBytes: obj) ifFalse:
  [^interpreterProxy primitiveFail].
  (sz := interpreterProxy byteSizeOf: obj) <= 256 ifFalse:
  [^interpreterProxy primitiveFail].
  srcPtr := interpreterProxy firstIndexableField: obj.
  self touch: srcPtr.
  self touch: deviceName.
  self touch: sz.
  self cCode: 'strncpy(deviceName, srcPtr, sz)'.
  self cCode: 'deviceName[sz] = NULL'.
 
  "do the work"
  self cCode: 'setDefaultSoundRecorder(deviceName)'.
+ interpreterProxy failed ifFalse: "pop arg, leave receiver"
- self success ifTrue: "pop arg, leave receiver"
  [interpreterProxy pop: 1]!