From a68b437b4cd2a00621f1693b4676d8764f9a590a Mon Sep 17 00:00:00 2001 From: "Pascal S. de Kloe" Date: Thu, 1 Aug 2024 21:49:31 +0200 Subject: [PATCH] [] for no flags, for reserved flags and <0> for zero --- info/code.go | 4 ++-- info/info.go | 34 +++++++++++++++++----------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/info/code.go b/info/code.go index bb4e635..c7577f0 100644 --- a/info/code.go +++ b/info/code.go @@ -169,7 +169,7 @@ const ( func (t TypeID) String() string { return typeIDLabels[t] } var typeIDLabels = [256]string{ - "notused<0>", + "<0>", "M_SP_NA_1", "M_SP_TA_1", "M_DP_NA_1", @@ -564,7 +564,7 @@ func (c Cause) String() string { } var causeLabels = [64]string{ - "notdef", + "<0>", "cyclic", // conform section 5 instead of "per/cyc" introduced by companion standard 101 "back", "spont", diff --git a/info/info.go b/info/info.go index b2262ab..23c88e1 100644 --- a/info/info.go +++ b/info/info.go @@ -318,12 +318,12 @@ const ( OK Qual = 0 // no remarks ) -// String returns the codes from the standard, comma separated, with "RES2" and -// "RES3" for the two reserved bits, and "OK" for none. +// String returns the codes from the standard, comma separated, with "[2]" and +// "[3]" for the two reserved bits, and "[]" for none. func (flags Qual) String() string { switch flags { case OK: // no flags - return "OK" + return "[]" case OV: return "OV" case EI: @@ -344,10 +344,10 @@ func (flags Qual) String() string { buf.WriteString(",OV") } if flags&2 != 0 { - buf.WriteString(",RES2") + buf.WriteString(",[2]") } if flags&4 != 0 { - buf.WriteString(",RES3") + buf.WriteString(",[3]") } if flags&EI != 0 { buf.WriteString(",EI") @@ -520,12 +520,12 @@ const ( SRD = RevStartFlag ) -// String returns the codes from the standard, comma separated, with "RES7" and -// "RES8" for the two reserved bits, and "<>" for none. +// String returns the codes from the standard, comma separated, with "[7]" and +// "[8]" for the two reserved bits, and "<>" for none. func (flags ProtEquipStart) String() string { switch flags { case 0: - return "<>" + return "[]" case GS: return "GS" case SL1: @@ -561,10 +561,10 @@ func (flags ProtEquipStart) String() string { buf.WriteString(",SRD") } if flags&64 != 0 { - buf.WriteString(",RES7") + buf.WriteString(",[7]") } if flags&128 != 0 { - buf.WriteString(",RES8") + buf.WriteString(",[8]") } return buf.String()[1:] } @@ -588,12 +588,12 @@ const ( CL3 = L3OutFlag ) -// String returns the codes from the standard, comma separated, with "RES5" -// through "RES8" for the four reserved bits, and "<>" for none. +// String returns the codes from the standard, comma separated, with "[5]" +// "[6]", "[7]" and "[8]" for the four reserved bits, and "[]" for none. func (flags ProtEquipOut) String() string { switch flags { case 0: - return "<>" + return "[]" case GC: return "GC" case CL1: @@ -619,16 +619,16 @@ func (flags ProtEquipOut) String() string { buf.WriteString(",CL3") } if flags&16 != 0 { - buf.WriteString(",RES5") + buf.WriteString(",[5]") } if flags&32 != 0 { - buf.WriteString(",RES6") + buf.WriteString(",[6]") } if flags&64 != 0 { - buf.WriteString(",RES7") + buf.WriteString(",[7]") } if flags&128 != 0 { - buf.WriteString(",RES8") + buf.WriteString(",[8]") } return buf.String()[1:] }