Skip to content

Fix style/indendation issues in sound_ahi.c.#85

Merged
sezero merged 1 commit intolibxmp:masterfrom
AliceLR:ahi-reindent-refactor
Mar 12, 2026
Merged

Fix style/indendation issues in sound_ahi.c.#85
sezero merged 1 commit intolibxmp:masterfrom
AliceLR:ahi-reindent-refactor

Conversation

@AliceLR
Copy link
Contributor

@AliceLR AliceLR commented Mar 6, 2026

  • Replace 4 space indentation with hard tabs.
  • Fix various instances of function { being on the wrong line.
  • Refactor init() to use early return like most other places in libxmp and xmp-cli.
  • Cast AHINAME to CONST_STRPTR to avoid pointer signedness warnings (bebbo amiga-gcc uses signed char by default, API defines this to unsigned char).
  • Clear active on init (avoids potential issues if the driver ever gets initialized twice in one session).

Only compile-tested with bebbo amiga-gcc 6.5.0b, so marking as draft for now.

@AliceLR AliceLR added this to the 4.3.0 milestone Mar 6, 2026
@AliceLR AliceLR marked this pull request as draft March 6, 2026 02:11
@sezero
Copy link
Collaborator

sezero commented Mar 7, 2026

Tested under linux-hosted i386 AROS.

Inverted condition for tmp in while loop of play():

--- sound_ahi.c~
+++ sound_ahi.c
@@ -149,11 +149,10 @@ static void play(void *b, int len) {
 		len -= chunk;
 		in += chunk;
 
-		tmp = CheckIO((struct IORequest *) AHIReq[active ^ 1]);
-
 		AHIReq[active]->ahir_Std.io_Data = AHIBuf[active];
 		AHIReq[active]->ahir_Std.io_Length = chunk;
+		tmp = CheckIO((struct IORequest *) AHIReq[active ^ 1]);
-		AHIReq[active]->ahir_Link = tmp ? AHIReq[active ^ 1] : NULL;
+		AHIReq[active]->ahir_Link = tmp ? NULL : AHIReq[active ^ 1];
 		SendIO((struct IORequest *) AHIReq[active]);
 		active ^= 1;
 	}

@AliceLR AliceLR force-pushed the ahi-reindent-refactor branch from 3b2841a to 492d889 Compare March 11, 2026 01:27
- Replace 4 space indentation with hard tabs.
- Fix various instances of function { being on the wrong line.
- Refactor init() to use early return like most other places in
  libxmp and xmp-cli.
- Cast AHINAME to CONST_STRPTR to avoid pointer signedness warnings
  (bebbo amiga-gcc uses signed char by default, API defines this
  to unsigned char).
- Clear active on init (avoids potential issues if the driver ever
  gets initialized twice in one session).
@AliceLR AliceLR force-pushed the ahi-reindent-refactor branch from 492d889 to df219bb Compare March 11, 2026 01:35
@AliceLR
Copy link
Contributor Author

AliceLR commented Mar 11, 2026

Inverted condition for tmp in while loop of play():

Should be fixed now.

@AliceLR AliceLR marked this pull request as ready for review March 11, 2026 01:37
@sezero
Copy link
Collaborator

sezero commented Mar 11, 2026

Should be fixed now.

Yes.

@AliceLR AliceLR requested a review from sezero March 11, 2026 23:49
@AliceLR
Copy link
Contributor Author

AliceLR commented Mar 11, 2026

I'm fairly certain this is equivalent to the old code and should still work (or at least have the same bugs as the old code). I may try to get the old adtools amigaos-cross-toolchain working, but this code does compile with my local build of bebbo's toolchain.

@sezero sezero merged commit 38b6ce7 into libxmp:master Mar 12, 2026
1 check passed
@AliceLR AliceLR deleted the ahi-reindent-refactor branch March 12, 2026 06:15
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