Skip to content

Conversation

@jerrylzy
Copy link

  • Extract LoadModuleAndAddSMBus helper method to reduce duplication
  • Simplify SMBus detection logic with consistent pattern for all types
  • Replace unused out parameters with discard pattern (_)
  • Convert nested using statements to simplified using declarations

* Extract LoadModuleAndAddSMBus helper method to reduce duplication
* Simplify SMBus detection logic with consistent pattern for all types
* Replace unused out parameters with discard pattern (_)
* Convert nested using statements to simplified using declarations
@Blacktempel
Copy link
Owner

Thank you, I will check this later.

@Blacktempel Blacktempel self-assigned this Sep 23, 2025
@Blacktempel
Copy link
Owner

Regarding mutexes I'd like to keep them nested for special debugging purposes.
I'm not sure if LoadModuleAndAddSMBus makes sense as this would prevent Piix4 at port 1 being loaded if port 0 does not work.
Not sure if that is possible, but some systems will probably make it possible.
I think it's better if we keep it the way it is right now.
Thank you :)

@jerrylzy
Copy link
Author

jerrylzy commented Sep 29, 2025

Regarding mutexes I'd like to keep them nested for special debugging purposes. I'm not sure if LoadModuleAndAddSMBus makes sense as this would prevent Piix4 at port 1 being loaded if port 0 does not work. Not sure if that is possible, but some systems will probably make it possible. I think it's better if we keep it the way it is right now. Thank you :)

The changes I made are functionally equivalent to existing code. The using declaration just means it expires at the end of the current scope, which is what you’re currently doing. It's the preferred / default way after C# 8.0. See IDE0063

And why would it prevent piix4 at port 1 from being loaded? It returns true as long as pawnIO.LoadModule is successful, which is what you’re currently doing. It’s okay if you prefer the way it is, but I feel like you didn’t really read the function LoadModuleAndAddSMBus.

image image

@Blacktempel
Copy link
Owner

I'll re-check in a bit. Maybe I mis-read/interpreted the logic.

@Blacktempel
Copy link
Owner

Sorry for the delay, I have a lot on my table at the moment. Can take a couple of days longer.
Have to setup a new development system aswell.

@jerrylzy
Copy link
Author

jerrylzy commented Oct 3, 2025

Sorry for the delay, I have a lot on my table at the moment. Can take a couple of days longer. Have to setup a new development system aswell.

No worries. My PR doesn't have any functional changes; it's just something I saw when I was debugging this area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants