method

signed_value

Importance_0
v2_5_5 - Show latest stable - 0 notes - Class: ValueUtil
signed_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 23
    def signed_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.