Type STATUS is made a new int with constants OK and ERROR declared.
In code where ERROR clashes with an already defined integer value,
the clashing variable is renamed to IERR. In other clashes where
STATUS is a variable that variable is renamed.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * libgnarl/s-interr__vxworks.adb (Interfaces.C): Remove as
        unused.
        (System.VxWorks.Ext): Import.
        (System.VxWorks.Ext.STATUS): use type.
        (STATUS): New subtype.
        (OK): New constant.
        (Interrupt_Connector): Return STATUS type vice int.
        (Interrupt_Connect, Notify_Interrupt, Unbind_Handler,
        Interrupt_Server_Task): Rename Status to Result. Assert Result =
        OK.
        * libgnarl/s-osinte__vxworks.adb (To_Clock_Ticks): Define constant
        IERR, and return it vice ERROR.
        (Binary_Semaphore_Delete): Return STATUS type vice int.
        (Binary_Semaphore_Obtain): Likewise.
        (Binary_Semaphore_Release): Likewise.
        (Binary_Semaphore_Flush): Likewise.
        * libgnarl/s-osinte__vxworks.ads (SVE): Renaming of
        System.VxWorks.Ext.
        (STATUS): Use SVE in declaration of subtype.
        (BOOL): Likewise.
        (vx_freq_t): Likewise.
        (t_id): Likewise.
        (gitpid): Use SVE in renaming of subprogram
        (Task_Stop): Likewise.
        (Task_Cont): Likewise.
        (Int_Lock): Likewise.
        (Int_Unlock): Likewise.
        (Set_Time_Slice): Likewise.
        (semDelete): Likewise.
        (taskCpuAffinitySet): Likewise.
        (taskMaskAffinitySet): Likewise.
        (sigset_t): Use SVE in declaration of type.
        (OK): Remove as unused.
        (ERROR): Likewise.
        (taskOptionsGet): return STATUS vice int.
        (taskSuspend): Likewise.
        (taskResume): Likewise.
        (taskDelay): Likewise.
        (taskVarAdd): Likewise.
        (taskVarDelete): Likewise.
        (taskVarSet): Likewise.
        (tlkKeyCreate): Likewise.
        (taskPrioritySet): Likewise.
        (semGive): Likewise.
        (semTake): Likewise.
        (Binary_Semaphore_Delete): Likewise.
        (Binary_Semaphore_Obtain): Likewise.
        (Binary_Semaphore_Release): Likewise.
        (Binary_Semaphore_Flush): Likewise.
        (Interrupt_Connect): Likewise.
        * libgnarl/s-taprop__vxworks.adb
        (System.VxWorks.Ext.STATUS): use type.
        (int): Syntactically align subtype.
        (STATUS): New subtype.
        (OK): New constant.
        (Finalize_Lock): Check STATUS vice int. Assert OK.
        (Finalize_Lock): Likewise.
        (Write_Lock): Likewise.
        (Write_Lock): Likewise.
        (Write_Lock): Likewise.
        (Unlock): Likewise.
        (Unlock): Likewise.
        (Unlock): Likewise.
        (Unlock): Likewise.
        (Sleep): Likewise.
        (Sleep): Likewise.
        (Sleep): Likewise.
        (Timed_Sleep): Likewise and test Result.
        (Timed_Delay): Likewise and test Result.
        (Wakeup): Likewise.
        (Yield): Likewise.
        (Finalize_TCB): Likewise.
        (Suspend_Until_True): Check OK.
        (Stop_All_Tasks): Declare Dummy STATUS vice in.  Check OK.
        (Is_Task_Context): Use OSI renaming.
        (Initialize): Use STATUS vice int.
        * libgnarl/s-vxwext.adb
        (IERR): Renamed from ERROR.
        (taskCpuAffinitySet): Return IERR (int).
        (taskMaskAffinitySet): Likewise.
        * libgnarl/s-vxwext.ads
        (STATUS): New subtype.
        (OK): New STATUS constant.
        (ERROR): Likewise.
        * libgnarl/s-vxwext__kernel-smp.adb
        (IERR): Renamed from ERROR.
        (Int_Lock): Return IERR.
        (semDelete): Return STATUS.
        (Task_Cont): Likewise.
        (Task_Stop): Likewise.
        * libgnarl/s-vxwext__kernel.adb
        (IERR): Renamed from ERROR.
        (semDelete): Return STATUS.
        (Task_Cont): Likewise.
        (Task_Stop): Likewise.
        (taskCpuAffinitySet): Return IERR (int)
        (taskMaskAffinitySet): Likewise.
        * libgnarl/s-vxwext__kernel.ads
        (STATUS): New subtype.
        (OK): New STATUS constant.
        (ERROR): Likewise.
        (Interrupt_Connect): Return STATUS
        (semDelete): Likewise.
        (Task_Cont): Likewise.
        (Task_Stop): Likewise.
        (Set_Time_Slice): Likewise.
        * libgnarl/s-vxwext__rtp-smp.adb
        (IERR): Renamed from ERROR.
        (Int_Lock): return IERR constant vice ERROR.
        (Interrupt_Connect): Return STATUS.
        (semDelete): Likewise.
        (Set_Time_Slice): Likewise.
        * libgnarl/s-vxwext__rtp.adb
        (IERR): Renamed from ERROR.
        (Int_Lock): return IERR constant vice ERROR.
        (Int_Unlock): Return STATUS.
        (semDelete): Likewise.
        (Set_Time_Slice): Likewise.
        (taskCpuAffinitySet): Return IERR (int)
        (taskMaskAffinitySet): Likewise.
        * libgnarl/s-vxwext__rtp.ads
        (STATUS): New subtype.
        (OK): New STATUS constant.
        (ERROR): Likewise.
        (Interrupt_Connect): Return STATUS
        (semDelete): Likewise.
        (Task_Cont): Likewise.
        (Task_Stop): Likewise.
        (Set_Time_Slice): Likewise.

Attachment: patch.diff.gz
Description: application/gzip

Reply via email to