method

unsigned_value

Importance_0
v2_5_5 - Show latest stable - 0 notes - Class: ValueUtil
unsigned_value(val, ty) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File ext/fiddle/lib/fiddle/value.rb, line 6
    def unsigned_value(val, ty)
      case ty.abs
      when TYPE_CHAR
        [val].pack("c").unpack("C")[0]
      when TYPE_SHORT
        [val].pack("s!").unpack("S!")[0]
      when TYPE_INT
        [val].pack("i!").unpack("I!")[0]
      when TYPE_LONG
        [val].pack("l!").unpack("L!")[0]
      when TYPE_LONG_LONG
        [val].pack("q").unpack("Q")[0]
      else
        val
      end
    end
Register or log in to add new notes.