Skip to content

Commit

Permalink
class library: Add necessary calls to this.primitiveFailed
Browse files Browse the repository at this point in the history
These primitive calls can return something besides errNone, and therefore require a call to this.primitiveFailed in order to properly throw the error

Signed-off-by: Scott Wilson <[email protected]>
  • Loading branch information
muellmusik committed Oct 4, 2015
1 parent b386579 commit e68e7e3
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion SCClassLibrary/Common/Collections/String.sc
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ String[char] : RawArray {

escapeChar { arg charToEscape; // $"
_String_EscapeChar
^this.primitiveFailed;
}
shellQuote {
^"'"++this.replace("'","'\\''")++"'"
Expand Down Expand Up @@ -292,7 +293,7 @@ String[char] : RawArray {
*readNew { arg file;
^file.readAllString;
}
prCat { arg aString; _ArrayCat }
prCat { arg aString; _ArrayCat; ^this.primitiveFailed; }

printOn { arg stream;
stream.putAll(this);
Expand Down
3 changes: 3 additions & 0 deletions SCClassLibrary/Common/Control/MIDIOut.sc
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,11 @@ MIDIIn {
}
*connectByUID {arg inport, uid;
_ConnectMIDIIn
^this.primitiveFailed;
}
*disconnectByUID {arg inport, uid;
_DisconnectMIDIIn
^this.primitiveFailed;
}

*prDispatchEvent { arg eventList, status, port, chan, b, c;
Expand Down Expand Up @@ -450,6 +452,7 @@ MIDIOut {

send { arg outport, uid, len, hiStatus, loStatus, a=0, b=0, late;
_SendMIDIOut
^this.primitiveFailed;
}

prSysex { arg uid, packet;
Expand Down
2 changes: 2 additions & 0 deletions SCClassLibrary/Common/Control/NetAddr.sc
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ NetAddr {

*langPort {
_GetLangPort
^this.primitiveFailed;
}

*matchLangIP {|ipstring|
_MatchLangIP
^this.primitiveFailed;
}
*localEndPoint {
^this.new(this.langIP, this.langPort)
Expand Down
1 change: 1 addition & 0 deletions SCClassLibrary/Common/Control/SerialPort.sc
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ SerialPort
// rx errors since last query
rxErrors {
_SerialPort_RXErrors
^this.primitiveFailed;
}

// always blocks
Expand Down
3 changes: 3 additions & 0 deletions SCClassLibrary/Common/Core/Symbol.sc
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@ Symbol {
}
isClassName {
_SymbolIsClassName
^this.primitiveFailed;
// returns true if first character of symbol is a capital letter
}
isMetaClassName {
_SymbolIsMetaClassName
^this.primitiveFailed;
// returns true if there is a meta class by this name
}
isPrefix { | other |
_SymbolIsPrefix
^this.primitiveFailed;
}
isPrimitiveName {
// returns true if symbol is a valid primitive name
Expand Down
1 change: 1 addition & 0 deletions SCClassLibrary/Common/GUI/Base/QView.sc
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ View : QObject {

*setGlobalEventEnabled { arg event, enabled;
_QWidget_SetGlobalEventEnabled
^this.primitiveFailed;
}

initView { arg parent;
Expand Down
2 changes: 2 additions & 0 deletions SCClassLibrary/Common/GUI/Base/QWindow.sc
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ Window

*screenBounds {
_QWindow_ScreenBounds
^this.primitiveFailed;
}

*availableBounds {
_QWindow_AvailableGeometry
^this.primitiveFailed;
}

*closeAll {
Expand Down
2 changes: 2 additions & 0 deletions SCClassLibrary/Common/GUI/iphone/Base/GUIScreen.sc
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ SCWindow {

prSetAlwaysOnTop{|boolean=true|
_SCWindow_AlwaysOnTop
^this.primitiveFailed;
}

acceptsClickThrough_{|boolean=true|
Expand All @@ -112,6 +113,7 @@ SCWindow {

prSetAcceptsClickThrough{|boolean=true|
_SCWindow_AcceptsClickThrough
^this.primitiveFailed;
}

refresh {
Expand Down
2 changes: 1 addition & 1 deletion SCClassLibrary/DefaultLibrary/Main.sc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Main : Process {

prOpenUDPPort {|portNum|
_OpenUDPPort
^false
^this.primitiveFailed;
}

// override in platform specific extension
Expand Down
2 changes: 2 additions & 0 deletions SCClassLibrary/Platform/linux/extMIDIOut.sc
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@
}
*connectByUID {arg outport, uid;
_ConnectMIDIOut
^this.primitiveFailed;
}
*disconnectByUID {arg outport, uid;
_DisconnectMIDIOut
^this.primitiveFailed;
}
}
2 changes: 2 additions & 0 deletions SCClassLibrary/scide_scqt/ScIDE.sc
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ Document {

prGetSelectionStart {|id|
_ScIDE_GetDocSelectionStart
^this.primitiveFailed;
}

selectionSize {
Expand All @@ -797,6 +798,7 @@ Document {

prGetSelectionRange {|id|
_ScIDE_GetDocSelectionRange
^this.primitiveFailed;
}

string { | rangestart, rangesize = 1 |
Expand Down

0 comments on commit e68e7e3

Please sign in to comment.