Skip to content

Commit

Permalink
Fix type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
PalumboN committed Feb 21, 2022
1 parent f9b484e commit 7a0fded
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion smalltalksrc/VMMaker/AbstractComposedImageAccess.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ AbstractComposedImageAccess >> createImageDirectory: imageFileName [
AbstractComposedImageAccess >> existSegment: segmentIndex inImage: imageFileName [

<var: #buffer declareC: 'char buffer[255]'>
<var: #sb declareC: 'stat'>
<var: #sb declareC: 'struct stat sb'>
| buffer fileName sb |
self simulationOnly: [
buffer := nil.
Expand Down
15 changes: 9 additions & 6 deletions smalltalksrc/VMMaker/ComposedImageReader.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Class {
ComposedImageReader >> readFieldsSTONFrom: file into: aStruct [

<inline: true>
<var: #fieldName declareC: 'char buffer[255]'>
<var: #fieldName declareC: 'char fieldName[255]'>
<var: #fieldValue type: #sqLong>
| fieldName fieldValue |
self simulationOnly: [
Expand All @@ -17,7 +17,7 @@ ComposedImageReader >> readFieldsSTONFrom: file into: aStruct [

[ self
fscanf: file
_: fieldFormat
_: fieldFormat "Y la coma?"
_: (self addressOf: fieldName)
_: (self addressOf: fieldValue)
] whileTrue: [
Expand All @@ -30,14 +30,15 @@ ComposedImageReader >> readFieldsSTONFrom: file into: aStruct [
ComposedImageReader >> readHeadSTONFrom: file into: aStruct [

<inline: true>
<var: #structName declareC: 'char buffer[255]'>
<var: #structName declareC: 'char structName[255]'>
| structName |
self simulationOnly: [ structName := ValueHolder new ].

self fscanf: file _: headFormat _: (self addressOf: structName).

aStruct withStructNameDo: [ :name |
self assert: name = structName contents ]
self simulationOnly: [
aStruct withStructNameDo: [ :name |
self assert: name = structName contents ] ]
]

{ #category : #api }
Expand Down Expand Up @@ -77,8 +78,9 @@ ComposedImageReader >> readImageNamed: imageName [
aHeader := self readHeaderFromImage: imageName.

self loadHeaderToMemory: aHeader.
interpreter allocateMemoryForImage: imageName withHeader: aHeader
interpreter allocateMemoryForImage: imageName withHeader: aHeader.

^ 0 "Must return sqInt"
]

{ #category : #reading }
Expand Down Expand Up @@ -148,6 +150,7 @@ ComposedImageReader >> readSegmentsFromImageFile: imageFileName header: aHeader
<var: #imageFile type: #sqImageFile>
<var: 'segInfo' type: #'SpurSegmentInfo *'>
<var: 'aHeader' type: #SpurImageHeaderStruct>
<var: #nextSegmentMetadata type: #ComposedSegmentMetadataStruct>
| bytesRead totalBytesRead segmentSize oldBase newBase segmentIndex existsNextSegment |
self prepareSegmentsToRead.

Expand Down

0 comments on commit 7a0fded

Please sign in to comment.