phin1x / go-ipp

Pure Go IPP library
Apache License 2.0
138 stars 35 forks source link

use int32 instead of int when parsing #11

Closed korylprince closed 4 years ago

korylprince commented 4 years ago

This fixes some parsing issues I've been having. In particular I'm using a OperationCupsGetPrinters request which returns all attributes for all printers. I was getting various errors like binary.Read: invalid type *int. Ultimately I discovered it was because in a few places int was used instead of int32. I'm on amd64, where int is (at least sometimes) 64bits instead of 32.

If the change to the public API of Resolution is unacceptable, I can rewrite the decodeResolution function to use the correct type privately.

phin1x commented 4 years ago

I think the change should be ok. I will point it out in the next minor release as a breaking change.