Eliot Miranda uploaded a new version of FileAttributesPlugin to project VM Maker:
http://source.squeak.org/VMMaker/FileAttributesPlugin.oscog-eem.58.mcz==================== Summary ====================
Name: FileAttributesPlugin.oscog-eem.58
Author: eem
Time: 6 September 2020, 8:20:59.63722 pm
UUID: cc44bb82-2ef7-4610-9f12-d884da5a1d86
Ancestors: FileAttributesPlugin.oscog-eem.57
Sigh; no need to store nils in a new Array.
=============== Diff against FileAttributesPlugin.oscog-eem.57 ===============
Item was changed:
----- Method: FileAttributesPlugin>>primitiveFileMasksAsArray (in category 'file primitives') -----
primitiveFileMasksAsArray
"Answer an array of well known file masks"
<inline: #always>
+ | masksArray masks |
- | masksArray masks nilObj |
masksArray := interpreterProxy instantiateClass: interpreterProxy classArray indexableSize: 8.
masksArray ifNil: [^interpreterProxy primitiveFailFor: PrimErrNoMemory].
masks := self cCoerceSimple: (interpreterProxy firstIndexableField: masksArray) to: #'sqInt *'.
- nilObj := interpreterProxy nilObject.
+ self cppIf: #S_IFSOCK defined ifTrue:
+ [masks at: 1 put: (interpreterProxy integerObjectOf: (self cCode: [#S_IFSOCK] inSmalltalk: [16rC000]))].
- self cppIf: #S_IFSOCK defined
- ifTrue: [masks at: 1 put: (interpreterProxy integerObjectOf: (self cCode: [#S_IFSOCK] inSmalltalk: [16rC000]))]
- ifFalse: [masks at: 1 put: nilObj].
+ self cppIf: #S_IFLNK defined ifTrue:
+ [masks at: 2 put: (interpreterProxy integerObjectOf: (self cCode: [#S_IFLNK] inSmalltalk: [16rA000]))].
- self cppIf: #S_IFLNK defined
- ifTrue: [masks at: 2 put: (interpreterProxy integerObjectOf: (self cCode: [#S_IFLNK] inSmalltalk: [16rA000]))]
- ifFalse: [masks at: 1 put: nilObj].
masks at: 3 put: (interpreterProxy integerObjectOf: (self cCode: [#S_IFREG] inSmalltalk: [16r8000])).
+ self cppIf: #S_IFBLK defined ifTrue:
+ [masks at: 4 put: (interpreterProxy integerObjectOf: (self cCode: [#S_IFBLK] inSmalltalk: [16r6000]))].
- self cppIf: #S_IFBLK defined
- ifTrue: [masks at: 4 put: (interpreterProxy integerObjectOf: (self cCode: [#S_IFBLK] inSmalltalk: [16r6000]))]
- ifFalse: [masks at: 1 put: nilObj].
masks at: 5 put: (interpreterProxy integerObjectOf: (self cCode: [#S_IFDIR] inSmalltalk: [16r4000])).
masks at: 6 put: (interpreterProxy integerObjectOf: (self cCode: [#S_IFCHR] inSmalltalk: [16r2000])).
+ self cppIf: #S_IFIFO defined ifTrue:
+ [masks at: 7 put: (interpreterProxy integerObjectOf: (self cCode: [#S_IFIFO] inSmalltalk: [16r1000]))].
- self cppIf: #S_IFIFO defined
- ifTrue: [masks at: 7 put: (interpreterProxy integerObjectOf: (self cCode: [#S_IFIFO] inSmalltalk: [16r1000]))]
- ifFalse: [masks at: 1 put: nilObj].
interpreterProxy methodReturnValue: masksArray!