Commit 409afabf authored by Robert Sprowson's avatar Robert Sprowson

Fix for signed pointer compares, and bogus OK button text

Explicity check list end pointers for 0 (notify_link) and -1 (fsb_link) rather than <= 0 signed compares, and the private word pointer can be 0 or -1 (the latter being used to prevent a loop when a call is made to NetFiler when it's dead or dying).
Fix to lookuptoken corrupting r5, meant that anything using ReportError or reporterror_ok would have corrupt flags in r1. Spotted with a failed logoff having a cent symbol instead of "OK".
Removed a NOP after WritePSRc no longer needed post HdrSrc-2_63.

Version 0.84. Tagged as 'NetFiler-0_84'
parent 918c34bf
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.83"
Module_Version SETA 83
Module_MajorVersion SETS "0.84"
Module_Version SETA 84
Module_MinorVersion SETS ""
Module_Date SETS "26 Jun 2016"
Module_ApplicationDate SETS "26-Jun-16"
Module_Date SETS "03 Jul 2016"
Module_ApplicationDate SETS "03-Jul-16"
Module_ComponentName SETS "NetFiler"
Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/NetFS/NetFiler"
Module_FullVersion SETS "0.83"
Module_HelpVersion SETS "0.83 (26 Jun 2016)"
Module_FullVersion SETS "0.84"
Module_HelpVersion SETS "0.84 (03 Jul 2016)"
END
/* (0.83)
/* (0.84)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.83
#define Module_MajorVersion_CMHG 0.84
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 26 Jun 2016
#define Module_Date_CMHG 03 Jul 2016
#define Module_MajorVersion "0.83"
#define Module_Version 83
#define Module_MajorVersion "0.84"
#define Module_Version 84
#define Module_MinorVersion ""
#define Module_Date "26 Jun 2016"
#define Module_Date "03 Jul 2016"
#define Module_ApplicationDate "26-Jun-16"
#define Module_ApplicationDate "03-Jul-16"
#define Module_ComponentName "NetFiler"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/NetFS/NetFiler"
#define Module_FullVersion "0.83"
#define Module_HelpVersion "0.83 (26 Jun 2016)"
#define Module_LibraryVersionInfo "0:83"
#define Module_FullVersion "0.84"
#define Module_HelpVersion "0.84 (03 Jul 2016)"
#define Module_LibraryVersionInfo "0:84"
......@@ -531,8 +531,8 @@ MessagesList DCD Message_SaveDesktop
Desktop_NetFiler_Code Entry "r7"
LDR wp, [r12]
CMP wp, #0
BLE %FT01
CMP wp, wp, ASR #31 ; 0 or -1
BEQ %FT01
LDR wp, [wp, #:INDEX:mytaskhandle]
CMP wp, #0
......@@ -625,8 +625,8 @@ NetFiler_ServiceMain
BEQ NetFiler_Service_StartedFiler
LDR wp, [r12]
CMP wp, #0
MOVLE pc, lr
CMP wp, wp, ASR #31 ; 0 or -1
MOVEQ pc, lr
TEQ r1, #Service_ModeChange
BEQ NetFiler_Service_ModeChange
......@@ -661,9 +661,9 @@ NetFiler_ServiceMain
[ Version >= 40
NetFiler_Service_MessageFileClosed Entry "r0,r12"
LDR r12, [r12] ; are we active?
CMP r12, #0
EXIT LE
LDR wp, [r12]
CMP wp, wp, ASR #31 ; 0 or -1
EXIT EQ
BL CopyMenus ; re-open message file etc.
......@@ -709,9 +709,9 @@ vduinput
NetFiler_Service_StartedFiler Entry
LDR r14, [r12] ; cancel 'don't start' flag
CMP r14, #0
MOVLT r14, #0
STRLT r14, [r12]
CMP r14, #-1
MOVEQ r14, #0
STREQ r14, [r12]
EXIT
......@@ -764,14 +764,15 @@ NetFiler_Service_StartFiler Entry "r2,r3,r6"
NetFiler_Service_Reset Entry "r0-r6"
LDR r2, [r12] ; cancel 'don't start' flag
CMP r2, #0
MOVLT r2, #0
STRLT r2, [r12]
CMP r2, #-1
MOVEQ r14, #0
STREQ r14, [r12]
MOVGT wp, r2
MOVGT r0, #0 ; Wimp has already gone bye-bye
STRGT r0, mytaskhandle
BLGT freeworkspace
CMP r2, #0
MOVHI wp, r2
MOVHI r0, #0 ; Wimp has already gone bye-bye
STRHI r0, mytaskhandle
BLHI freeworkspace
EXIT ; Sorry, but no can do errors here
......@@ -927,8 +928,8 @@ findstation Entry ; NB assume V unset on entry
02
MOV r3, r2
LDR r2, [r2, #notify_link]
CMP r2, #0
BGT %BT01
CMP r2, #0 ; List end?
BNE %BT01
Push "r1,r3"
......@@ -984,8 +985,9 @@ freeworkspace ROUT
LDR r4, [r2, #fsb_link] ; r4 --> next one
MOV r0, #ModHandReason_Free
SWI XOS_Module
02 SUBS r2, r4, #0
BGT %BT01
02 CMP r4, #-1
MOVNE r2, r4
BNE %BT01 ; List end?
MOV r0, #13
MOV r1, #Event_Econet_OSProc
......@@ -1033,13 +1035,13 @@ ErrorAbort
NetFiler_Start ROUT
LDR wp, [r12]
CMP wp, #0
CMP wp, wp, ASR #31 ; 0 or -1
addr r0, ErrorBlock_CantStartNetFiler, LE
MOVLE r1, #0 ; Token 'UseDesk' is in global messages
MOVLE r2, #0 ; Internal buffer
addr r4, NetFiler_TitleString, LE
SWILE MessageTrans_ErrorLookup
addr r0, ErrorBlock_CantStartNetFiler, EQ
MOVEQ r1, #0 ; Token 'UseDesk' is in global messages
MOVEQ r2, #0 ; Internal buffer
addr r4, NetFiler_TitleString, EQ
SWIEQ MessageTrans_ErrorLookup
ADRL sp, stacktop ; STACK IS NOW VALID!
......@@ -1349,14 +1351,14 @@ event_null_reason Entry
02
MOV r3, r2
LDR r2, [r3, #notify_link]
03 CMP r2, #0 ; clears V (could be set earlier)
BGT %BT01
03 CMP r2, #0 ; List end?
BNE %BT01
[ Version >= 29
LDR r14, notifylist
CMP r14, #0
MOVLE r14, #0
STRLE r14, nullswanted ; nulls not needed any more
MOVEQ r14, #0
STREQ r14, nullswanted ; nulls not needed any more
Debug ndr,"After notify scanning: nullswanted =",#nullswanted
]
......@@ -1495,8 +1497,9 @@ matchiconbar Entry
TEQ r14, r4
EXIT EQ
LDR r2, [r2, #fsb_link]
02 CMP r2, #1
BGE %BT01
02 CMP r2, #-1
BNE %BT01
CMP r2, #0 ; r2 = -1, clear Z
EXIT
......@@ -1851,8 +1854,8 @@ EncodeMenu Entry "r1-r3"
MOVGT r4, r8
02
LDR r2, [r2, #fsb_link]
CMP r2, #0
BGT %BT01
CMP r2, #-1
BNE %BT01 ; List end?
; update width, and mark last item (there must be at least one)
......@@ -2212,8 +2215,8 @@ GetStationName Entry "r2"
BEQ %FT01 ; found it!
LDR r2, [r2, #fsb_link]
22 CMP r2, #0
BGT %BT02
22 CMP r2, #-1
BNE %BT02 ; List end?
; the current fs is not in the list - make up a name as best we can!
......@@ -3002,8 +3005,9 @@ innerloop
LDR r2, [r2, #fsb_link]
endloop
CMP r2, #0
BGT innerloop ; NB: Z unset when loop finishes
CMP r2, #-1
BNE innerloop ; List end?
CMP r2, #0 ; NB: Z unset when loop finishes
foundicon
ADD sp, sp, #8 ; don't need these any more
......@@ -3633,8 +3637,8 @@ readFSList Entry "r1-r8"
STR r14, [r2, #fsb_iconhandle]
LDR r2, [r2, #fsb_link]
02
CMP r2, #0
BGT %BT01
CMP r2, #-1
BNE %BT01 ; List end?
]
MOV r8, #1
......@@ -3749,8 +3753,8 @@ closeit
notfs
LDR r2, [r2, #fsb_link]
03
CMP r2, #0
BGT %BT02
CMP r2, #-1
BNE %BT02
[ Version >= 22
STRB r3, fsviewerchanged ; R3 MUST BE NON-ZERO !!!
......@@ -3850,8 +3854,8 @@ donefs
BLEQ checklogoff ; remove dirs on this FS
LDR r2, [r2, #fsb_link]
02 CMP r2, #0
BGT %BT01
02 CMP r2, #-1
BNE %BT01
; pass 3 - add icons for new fileservers, and clear logon_flag bit
......@@ -3866,8 +3870,8 @@ donefs
BLNE AddToIconBar
LDR r2, [r2, #fsb_link]
02 CMP r2, #0
BGT %BT01
02 CMP r2, #-1
BNE %BT01
; pass 4 - delete blocks for discnames which don't exist any more
; this is particularly important for fileservers with floppy discs
......@@ -3878,8 +3882,8 @@ dopass4
ADR r4, fs_headpointer-fsb_link
01
LDR r2, [r4, #fsb_link]
CMP r2, #0
BLE %FT02
CMP r2, #-1
BEQ %FT02
LDR r14, [r2, #fsb_iconhandle]
TST r14, #unknown_flag
[ Version >= 26
......@@ -3976,8 +3980,8 @@ checklogoff Entry "r1-r4"
BNE %FT03
11 LDR r4, [r4, #fsb_link]
02 CMP r4, #0
BGT %BT01
02 CMP r4, #-1
BNE %BT01
ADR r1, userdata
ADD r4, r2, #fsb_name
......@@ -4020,20 +4024,19 @@ SortFSList ROUT
SWI XOS_EnterOS ; use SVC mode here (Scratch space)
BL sortfslist
WritePSRc USR_mode, r2
NOP
MOV pc, lr ; this lot helps Tim to debug the MOS
sortfslist Entry
ADR r2, ScratchSpace
LDR r3, fs_headpointer
CMP r3, #0
EXIT LE ; can't sort a null array!
CMP r3, #-1
EXIT EQ ; can't sort a null array!
01
STR r3, [r2], #4
LDR r3, [r3, #fsb_link]
CMP r3, #0
BGT %BT01
CMP r3, #-1
BNE %BT01
ADR r1, ScratchSpace ; r1 --> pointer array
SUB r0, r2, r1
......@@ -4571,7 +4574,7 @@ str_messagefile DCB "Wimp:Messages.NetFiler", 0
! 1, "Sorry, this source file can't make version 0.38"
]
lookuptoken Entry "r0-r4"
lookuptoken Entry "r0-r5"
DebugS ndr,"Look up token ",R0
DebugS ndr,"Parameter 0 = ",R3
......@@ -4686,8 +4689,8 @@ SaveDesktop ROUT
EXIT VS
02
LDR r2, [r2, #fsb_link]
CMP r2, #0
BGT %BT01
CMP r2, #-1
BNE %BT01
EXIT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment