From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f51.google.com ([209.85.218.51]) by ewsd; Tue Sep 22 19:32:02 EDT 2020 Received: by mail-ej1-f51.google.com with SMTP id i26so25159912ejb.12 for <9front@9front.org>; Tue, 22 Sep 2020 16:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=LcQXlQ4oRHErl3DphLufpU6ikr7lvvxA+e3K4mc3rlo=; b=pocQI8hX+yTFIZvstQWiW0sK+x5ef1JbNzBt2Plnx4ODpnvenYKBiD1FvDSv9pVRyr fypO18h1PCk9vayFwdNkDFBL31IxWfk/K4YiJ+HImFoyuNvXUmKUFOQCo+ME8FKGUu3u ucM+0pwcs18WJISwTqDi9/ZL77BP6Iqo8c81mjlbzYgsAUJCmxRuyt6yXAdB2vlqCvyP ioM44mr2Lqtp9esswOgS2s/dbpe5ZhNWJZoyrVgDXB/JTzvlxF37oStDoftTla4EDKQK RC/f05HnNy1/tw8HpiZE70EGYVsQ/hTw3KinD6YgiMod63g9WzpttB2SngMdg0MlAd9x NWRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=LcQXlQ4oRHErl3DphLufpU6ikr7lvvxA+e3K4mc3rlo=; b=ZjQT4hfuIIczIRDaHwIY+InbRnlrS8A93NZuCujM38inWkWJW7bnzEoBPOnecGb82P ZpTSp5c9FnL6tsZQTHY/7d7MGw8oQ2PozVj7cBIZQPSoFmQXVTmZHRragQ/8cFGmiU58 TBaST3ZZjAG+XcYdNo95ERF0V4DC0XGmgPhH0DlzIbLV+nYbMbVGwvPHkwO9FaBGwH4Y ELxofX9lX9M/kWP4lzBhAEE865GzWPU6kHyNthEwBMuqxgD3l/4SqpcH06yyZa5WZOES /U/oxV65aT95QKYC+/rMIb8oSgql5AliAWXnRFRAN4HhMxi7wiaM6bAazDseh9YQEfv1 D9bQ== X-Gm-Message-State: AOAM532Q6iVLBcDQQw0XO/l+ilPLW9JpmLxKP3SwgTp1cxyZQo+6rnxt YH8VnJna2p1jaWlqaYTvfYft2Ribuwh7+ijon0yYxPlB X-Google-Smtp-Source: ABdhPJyxXsluix+8tgqhVVBDkS/CDWf6inKIRwB2SYhGas+7ZgxwDM52qmrBKctVVanoqrju+uX6AX0pwkquDMKNpuA= X-Received: by 2002:a17:906:9346:: with SMTP id p6mr7249210ejw.305.1600817516357; Tue, 22 Sep 2020 16:31:56 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:906:29c2:0:0:0:0 with HTTP; Tue, 22 Sep 2020 16:31:55 -0700 (PDT) In-Reply-To: References: <30E43038E10D62CFD2B73EDD106FC287@eigenstate.org> <9E1DC0FC2EFF9A9EA7D4B8220CA6403C@eigenstate.org> From: hiro <23hiro@gmail.com> Date: Wed, 23 Sep 2020 01:31:55 +0200 Message-ID: Subject: Re: [9front] Re: vncv(1): support for RFB 3.8 To: 9front@9front.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: rich-client component information-scale descriptor persistence-oriented interface i agree srvversion =3D=3D 38 is clearer. clearly he has spent effort minimizing this to achieve maximal expressiveness with least redundency. On 9/23/20, Silas McCroskey wrote: > 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 w= rote: >> >> 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 >> thinking. In our specific case, is srvversion =3D=3D SrvVersion38 actual= ly >> clearer than srvversion =3D=3D 38? >> >> In any case, I would happily change the patch if enums are preferred. >