I’m doing you a favor

    • rmuk@feddit.uk
      link
      fedilink
      English
      arrow-up
      11
      ·
      1 year ago

      Steadily increasing unsigned integer on a long-running piece of infrastructure: bonjour

      • socsa@lemmy.ml
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        1 year ago

        Laughs in

        struct LooooongCounter {
            long highPart;
            long lowPart;
        };
        
        • TheyCallMeHacked
          link
          fedilink
          arrow-up
          3
          ·
          1 year ago
          LooooongCounter operator++(const LooooongCounter& c) {
              if(c.lowPart == ULONG_MAX) {
                  c.highPart++;
                  c.lowPart = 0;
              }
              else c.lowPart++;
          }