From c7d02dc356a6f3cd546d5d7b79f62a4d430f656b Mon Sep 17 00:00:00 2001 From: Fabian Weber <> Date: Mon, 9 Mar 2020 12:58:54 +0100 Subject: [PATCH] use int8 instead of uint8 --- attribute.go | 4 ++-- constants.go | 34 +++++++++++++++++----------------- reqest.go | 4 ++-- response.go | 4 ++-- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/attribute.go b/attribute.go index 0790155..ba77928 100644 --- a/attribute.go +++ b/attribute.go @@ -453,7 +453,7 @@ func (d *AttributeDecoder) decodeDate() ([]int, error) { } is := make([]int, length) - var ti uint8 + var ti int8 for i := int16(0); i < length; i++ { if err = binary.Read(d.reader, binary.BigEndian, &ti); err != nil { @@ -489,7 +489,7 @@ func (d *AttributeDecoder) decodeRange() ([]int, error) { type Resolution struct { Height int Width int - Depth uint8 + Depth int8 } func (d *AttributeDecoder) decodeResolution() (res Resolution, err error) { diff --git a/constants.go b/constants.go index 0f5b04a..02ebfd6 100644 --- a/constants.go +++ b/constants.go @@ -231,27 +231,27 @@ const ( ) const ( - JobStatePending uint8 = 0x03 - JobStateHeld uint8 = 0x04 - JobStateProcessing uint8 = 0x05 - JobStateStopped uint8 = 0x06 - JobStateCanceled uint8 = 0x07 - JobStateAborted uint8 = 0x08 - JobStateCompleted uint8 = 0x09 + JobStatePending int8 = 0x03 + JobStateHeld int8 = 0x04 + JobStateProcessing int8 = 0x05 + JobStateStopped int8 = 0x06 + JobStateCanceled int8 = 0x07 + JobStateAborted int8 = 0x08 + JobStateCompleted int8 = 0x09 ) const ( - DocumentStatePending uint8 = 0x03 - DocumentStateProcessing uint8 = 0x05 - DocumentStateCanceled uint8 = 0x07 - DocumentStateAborted uint8 = 0x08 - DocumentStateCompleted uint8 = 0x08 + DocumentStatePending int8 = 0x03 + DocumentStateProcessing int8 = 0x05 + DocumentStateCanceled int8 = 0x07 + DocumentStateAborted int8 = 0x08 + DocumentStateCompleted int8 = 0x08 ) const ( - PrinterStateIdle uint8 = 0x0003 - PrinterStateProcessing uint8 = 0x0004 - PrinterStateStopped uint8 = 0x0005 + PrinterStateIdle int8 = 0x0003 + PrinterStateProcessing int8 = 0x0004 + PrinterStateStopped int8 = 0x0005 ) const ( @@ -270,8 +270,8 @@ const ( const ( CharsetLanguage = "en-US" Charset = "utf-8" - ProtocolVersionMajor = uint8(2) - ProtocolVersionMinor = uint8(0) + ProtocolVersionMajor = int8(2) + ProtocolVersionMinor = int8(0) DefaultJobPriority = 50 diff --git a/reqest.go b/reqest.go index 478df85..6681ea3 100644 --- a/reqest.go +++ b/reqest.go @@ -7,8 +7,8 @@ import ( ) type Request struct { - ProtocolVersionMajor uint8 - ProtocolVersionMinor uint8 + ProtocolVersionMajor int8 + ProtocolVersionMinor int8 Operation int16 RequestId int32 diff --git a/response.go b/response.go index bd3f56b..3ce0f9f 100644 --- a/response.go +++ b/response.go @@ -11,8 +11,8 @@ import ( type Attributes map[string][]Attribute type Response struct { - ProtocolVersionMajor uint8 - ProtocolVersionMinor uint8 + ProtocolVersionMajor int8 + ProtocolVersionMinor int8 StatusCode int16 RequestId int32