Click here to Skip to main content
15,512,419 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: This is actually cleaned up! Pin
honey the codewitch15-Dec-21 7:58
mvahoney the codewitch15-Dec-21 7:58 
GeneralRe: This is actually cleaned up! Pin
jschell23-Jan-22 9:54
jschell23-Jan-22 9:54 
GeneralRe: This is actually cleaned up! Pin
honey the codewitch24-Jan-22 2:00
mvahoney the codewitch24-Jan-22 2:00 
GeneralRe: This is actually cleaned up! Pin
jschell30-Jan-22 7:13
jschell30-Jan-22 7:13 
GeneralRe: This is actually cleaned up! Pin
honey the codewitch30-Jan-22 10:02
mvahoney the codewitch30-Jan-22 10:02 
GeneralRe: This is actually cleaned up! Pin
jschell17-Feb-22 11:33
jschell17-Feb-22 11:33 
JokeRe: This is actually cleaned up! Pin
Nelek15-Dec-21 11:59
protectorNelek15-Dec-21 11:59 
GeneralRe: This is actually cleaned up! Pin
Fueled By Decaff15-Dec-21 7:30
Fueled By Decaff15-Dec-21 7:30 
Yep, you are right, I would not want to see this preprocessor macros, that would fry my brain.

Could you put the pins_l and and pins_h into a single uint64_t or is that not supported?

That would make the processing easier.

Failing that you could simplify it a little.

if(pin_d0>31) {
    b = (pins_h>>(pin_d0&31))&1;
} else if(pin_d0>-1) {
    b = (pins_l>>pin_d0)&1;
} else {
    b=0;
}


I am sure there are other optimisations that could be done, but I am done for the day. Good luck!
GeneralRe: This is actually cleaned up! Pin
honey the codewitch15-Dec-21 7:32
mvahoney the codewitch15-Dec-21 7:32 
GeneralRe: This is actually cleaned up! Pin
Al_Brown31-Dec-21 2:44
Al_Brown31-Dec-21 2:44 
GeneralRe: This is actually cleaned up! Pin
honey the codewitch31-Dec-21 4:14
mvahoney the codewitch31-Dec-21 4:14 
GeneralRe: This is actually cleaned up! Pin
Al_Brown31-Dec-21 5:38
Al_Brown31-Dec-21 5:38 
GeneralMessage Closed Pin
13-Dec-21 15:55
mvahoney the codewitch13-Dec-21 15:55 
GeneralRe: IME, It's a lot harder to shop for people when they get pregnant Pin
Brisingr Aerowing13-Dec-21 16:01
professionalBrisingr Aerowing13-Dec-21 16:01 
GeneralRe: IME, It's a lot harder to shop for people when they get pregnant Pin
honey the codewitch13-Dec-21 16:06
mvahoney the codewitch13-Dec-21 16:06 
GeneralI'm not sure how I feel about Forth implemented on a Cortex M-0 Pin
honey the codewitch13-Dec-21 1:09
mvahoney the codewitch13-Dec-21 1:09 
GeneralRe: I'm not sure how I feel about Forth implemented on a Cortex M-0 Pin
trønderen13-Dec-21 17:55
trønderen13-Dec-21 17:55 
GeneralRe: I'm not sure how I feel about Forth implemented on a Cortex M-0 Pin
Richard Deeming13-Dec-21 22:58
mveRichard Deeming13-Dec-21 22:58 
JokeRe: I'm not sure how I feel about Forth implemented on a Cortex M-0 Pin
englebart1-Sep-22 16:12
professionalenglebart1-Sep-22 16:12 
GeneralRe: I'm not sure how I feel about Forth implemented on a Cortex M-0 Pin
Rick York14-Dec-21 20:45
mveRick York14-Dec-21 20:45 
GeneralRe: I'm not sure how I feel about Forth implemented on a Cortex M-0 Pin
Gary Wheeler31-Dec-21 5:07
Gary Wheeler31-Dec-21 5:07 
GeneralRe: I'm not sure how I feel about Forth implemented on a Cortex M-0 Pin
Rick York31-Dec-21 8:44
mveRick York31-Dec-21 8:44 
GeneralPreparing for the future... Pin
Richard Deeming8-Dec-21 2:13
mveRichard Deeming8-Dec-21 2:13 
JokeRe: Preparing for the future... Pin
Daniel Pfeffer8-Dec-21 2:30
professionalDaniel Pfeffer8-Dec-21 2:30 
GeneralRe: Preparing for the future... Pin
PIEBALDconsult8-Dec-21 4:09
professionalPIEBALDconsult8-Dec-21 4:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.