!=========================================================================
! Copyright (C) VMware, Inc. 1986-2011.  All Rights Reserved.
!
! $Id: convoopfixup.topaz,v 1.5 2008-01-09 22:50:09 stever Exp $
!
! Description: Does OOP fix-up for classes that did not have reserved
! symbols in earlier releases.
!
!=========================================================================

expectvalue %SmallInteger
run
  | oldOop newOop |
  1 to: (ConvNonReservedToReservedList size - 1) by: 2 do: [ :i |
    oldOop := ConvNonReservedToReservedList at: i.
    oldOop == nil 
      ifTrue: [ ^ i ].

    "Convert the Metaclass to 5.0 - so that class methods will
     be recognized by the virtual machine."
    (oldOop _class) convertTo5.
    ].
^ true
%
commit
!
! logout
! login

iferror exit
expectvalue %SmallInteger
run
  | oldOop newOopNum |
  1 to: (ConvNonReservedToReservedList size - 1) by: 2 do: [ :i |
    oldOop := ConvNonReservedToReservedList at: i.
    oldOop == nil 
      ifTrue: [ ^ i ].

    newOopNum := (ConvNonReservedToReservedList at: (i + 1)) asOop.

    (oldOop _class _class == Metaclass)
      ifFalse: [ ^ 'Mismatched convresoops41.txt provided' ].

    oldOop _unsafeSetOop: newOopNum.
    ].

  ^ ConvNonReservedToReservedList size.
%
commit

iferr 1 stk
iferr 2 stack
run
  | anAssoc |

  anAssoc := Globals associationAt: #RcBag.
  anAssoc key: #RcIdentityBag.
  Globals addAssociation: anAssoc.
  Globals removeKey: #RcBag.

  anAssoc := Globals associationAt: #RcHashDictionary.
  anAssoc key: #RcKeyValueDictionary.
  Globals addAssociation: anAssoc.
  Globals removeKey: #RcHashDictionary.

^ true
%
commit
