mycodesucks@kbin.social to Programmer Humor@lemmy.ml · 1 year agoIt's not greatmedia.kbin.socialimagemessage-square67fedilinkarrow-up11.48Kfile-text
arrow-up11.48KimageIt's not greatmedia.kbin.socialmycodesucks@kbin.social to Programmer Humor@lemmy.ml · 1 year agomessage-square67fedilinkfile-text
minus-squarermuk@feddit.uklinkfedilinkEnglisharrow-up11·1 year agoSteadily increasing unsigned integer on a long-running piece of infrastructure: bonjour
minus-squaresocsa@lemmy.mllinkfedilinkarrow-up3·edit-21 year agoLaughs in struct LooooongCounter { long highPart; long lowPart; };
minus-squareTheyCallMeHacked@discuss.tchncs.delinkfedilinkarrow-up3·1 year agoLooooongCounter operator++(const LooooongCounter& c) { if(c.lowPart == ULONG_MAX) { c.highPart++; c.lowPart = 0; } else c.lowPart++; }
Steadily increasing unsigned integer on a long-running piece of infrastructure: bonjour
Laughs in
struct LooooongCounter { long highPart; long lowPart; };
LooooongCounter operator++(const LooooongCounter& c) { if(c.lowPart == ULONG_MAX) { c.highPart++; c.lowPart = 0; } else c.lowPart++; }