Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring globals #9

Open
SamuraiCrow opened this issue Feb 3, 2020 · 2 comments
Open

Refactoring globals #9

SamuraiCrow opened this issue Feb 3, 2020 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@SamuraiCrow
Copy link
Contributor

After having looked through the eecmain.e file, there is a great possibility of modularizing the code using OOP. For example there are many places where g_optosid is checked against all the constants: OSID_NONE, OSID_MORPHOS, OSID_AMIGAOS and OSID_AMIGAOS4. These could all be combined using inheritance by making g_optosid into a context class and making all the IF, ELSIF, ELSEIF, ELSE, ENDIF statements into a method in that class. The context class may also keep track of library modes, ELF vs. HUNK executable types, and so on with all of the non-applicable methods of library mode, for example, being returned as no-ops in executable mode.

Using this may allow the contexts to be reimplemented as shared libraries for all the different sets of startup-codes and code generators. Some contexts will require more than one codegen such as MorphOS being able to use mixed binaries containing both 68k and PPC code.

@SamuraiCrow SamuraiCrow added enhancement New feature or request Low priority labels Feb 3, 2020
@SamuraiCrow
Copy link
Contributor Author

This is a prerequisite of adding more platforms, IMO, because then all the conditionals are replaced all at once using inheritance of the context abstract class rather than a dozen different places.

@SamuraiCrow SamuraiCrow changed the title Major refactoring Refactoring OS ID Sep 11, 2022
@SamuraiCrow SamuraiCrow added this to the Release 2.0 milestone May 1, 2023
@SamuraiCrow
Copy link
Contributor Author

This is now identified as a prerequisite of #6 because globals cannot be safely shared across modular networks of shared libraries.

@SamuraiCrow SamuraiCrow changed the title Refactoring OS ID Refactoring globals Jan 18, 2024
@SamuraiCrow SamuraiCrow modified the milestones: Release 3.0, Release 2.0 Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant