From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f49.google.com ([209.85.218.49]) by ewsd; Tue Sep 22 19:10:50 EDT 2020 Received: by mail-ej1-f49.google.com with SMTP id q13so25127064ejo.9 for <9front@9front.org>; Tue, 22 Sep 2020 16:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=FtvcpOXYCj4UZRsBAFzoSPkt+SgSNMGXXvPhA8hDg0k=; b=dlRE8VNMmk1GUZVA9nV3lsysZ7H6sspnNFNLM0zPnfbznTLEii/MzrW3LqNtPs1gg5 f3m/PvXw+oM0j+Jzvg3fbPcjzQX6dHct47E2P5srzqhL9mtVzmxeq3f5hygahGzP/too vb0wAR7ATlw7ivT95iwo21ZThGxsdRXYSMQQ1CYvvJG7VOlwvk0ACTgShzt7aekx38BJ DXEK2jy01uQuOf/LP4sAEKJavPi9N7CL4KHvpMwmhSRlaQCOOWjXev2t9lRKa6Ef2o3/ GdS/hP/soOixCugyAIoUYoDMM8gJ9ZReLlDTqIGhsWRsecWUUlGybv8wf0cU0Tgh1wbn 5oKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=FtvcpOXYCj4UZRsBAFzoSPkt+SgSNMGXXvPhA8hDg0k=; b=scnfCl0aH8GcKpitltEMpDI0BRY04rFaVZIOY1KQesb6jJf36taoEfTmryXnU4TWiG GqVXAwSpIBClUU/GHU4q2u95Vv/gk99c8zCtBv0b68hGcjOpYZYqQpX9v7lGfSvf+bl5 WVDXkPWvUaZq/z3VMjlJvyvWZ0qE+KjQI+GiGzkkEq9TshqgvVvXs3ZMfFrlHyMlTiv6 OsJ3aNa4Xxk25JK9tWp7vROkiAG5ZEnymB72SeYP3Yd/WmkEC6GEBZ1ltrcAIydydi3S BRg1NjtrthNIZtfDhZA3HInYiSc52y3kyXl01pgbj477SC1AdPTkk3Lv8ve2Xmhm9R9E DSjQ== X-Gm-Message-State: AOAM531seUo8CTEK6gRWksBtwoJJCs0DYzlH0lJ9kuZ7lUVLHt1ejUxg DvoO9mXoL2zJK9rAgXE2T+2afAw72PXZpfYaA54= X-Google-Smtp-Source: ABdhPJySxZi19dHNfy5UiG1ADRnfSk1Pe0XTS84WHxmg/etFBcWskhotX7BKHQHUVXkhIY8uh77j01cAMEshFgXAV2U= X-Received: by 2002:a17:906:1909:: with SMTP id a9mr7225625eje.127.1600816245607; Tue, 22 Sep 2020 16:10:45 -0700 (PDT) MIME-Version: 1.0 References: <30E43038E10D62CFD2B73EDD106FC287@eigenstate.org> <9E1DC0FC2EFF9A9EA7D4B8220CA6403C@eigenstate.org> In-Reply-To: From: Silas McCroskey Date: Tue, 22 Sep 2020 16:10:34 -0700 Message-ID: Subject: Re: [9front] Re: vncv(1): support for RFB 3.8 To: =?UTF-8?Q?Iruat=C3=A3_Souza?= Cc: 9front@9front.org, ori@eigenstate.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: generic metadata component Well beyond just the usual "avoid magic numbers" advice, with version numbers in particular enums let you use a format like VERS_3_8 or so to make the inherent separation more clear, especially to distinguish between something like 3.11.1 and 3.1.11. - sam-d On Tue, Sep 22, 2020 at 1:58 PM Iruat=C3=A3 Souza wro= te: > > Le mar. 22 sept. 2020 =C3=A0 22:36, Silas McCroskey = a =C3=A9crit : >> >> > + if(strncmp(msg, "RFB 003.008\n", VerLen) =3D=3D 0) >> > + srvversion =3D 38; >> > + else >> > + srvversion =3D 33; >> >> > + if (srvversion =3D=3D 38) >> >> This kind of thing should almost certainly be using enums instead of >> magic numbers. >> >> - sam-d > > > Usually I would promptly agree with that suggestion, but it got me thinki= ng. In our specific case, is srvversion =3D=3D SrvVersion38 actually cleare= r than srvversion =3D=3D 38? > > In any case, I would happily change the patch if enums are preferred.