Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 581 for uvarint (0.19 sec)

  1. src/encoding/binary/varint_test.go

    	testConstant(t, 64, MaxVarintLen64)
    }
    
    func testVarint(t *testing.T, x int64) {
    	buf := make([]byte, MaxVarintLen64)
    	n := PutVarint(buf, x)
    	y, m := Varint(buf[0:n])
    	if x != y {
    		t.Errorf("Varint(%d): got %d", x, y)
    	}
    	if n != m {
    		t.Errorf("Varint(%d): got n = %d; want %d", x, m, n)
    	}
    
    	buf2 := []byte("prefix")
    	buf2 = AppendVarint(buf2, x)
    	if string(buf2) != "prefix"+string(buf[:n]) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 16 23:09:19 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/typecheck/iexport.go

    //         }
    //     }
    //
    //     Fingerprint [8]byte
    //
    // uvarint means a uint64 written out using uvarint encoding.
    //
    // []T means a uvarint followed by that many T objects. In other
    // words:
    //
    //     Len   uvarint
    //     Elems [Len]T
    //
    // stringOff means a uvarint that indicates an offset within the
    // Strings section. At that offset is another uvarint, followed by
    // that many bytes, which form the string value.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jul 21 02:40:02 UTC 2023
    - 6.8K bytes
    - Viewed (0)
  3. src/encoding/binary/varint.go

    }
    
    // AppendVarint appends the varint-encoded form of x,
    // as generated by [PutVarint], to buf and returns the extended buffer.
    func AppendVarint(buf []byte, x int64) []byte {
    	ux := uint64(x) << 1
    	if x < 0 {
    		ux = ^ux
    	}
    	return AppendUvarint(buf, ux)
    }
    
    // PutVarint encodes an int64 into buf and returns the number of bytes written.
    // If the buffer is too small, PutVarint will panic.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  4. src/internal/trace/batchcursor.go

    	}
    	n := 1
    
    	// Read timestamp diff.
    	ts, nb := binary.Uvarint(b[n:])
    	if nb <= 0 {
    		return 0, 0, fmt.Errorf("found invalid uvarint for timestamp")
    	}
    	n += nb
    
    	// Read the rest of the arguments.
    	for i := 0; i < len(spec.Args)-1; i++ {
    		arg, nb := binary.Uvarint(b[n:])
    		if nb <= 0 {
    			return 0, 0, fmt.Errorf("found invalid uvarint")
    		}
    		e.args[i] = arg
    		n += nb
    	}
    	return n, timestamp(ts), nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  5. src/encoding/binary/example_test.go

    		{0x01},
    		{0x02},
    		{0x7f},
    		{0x80, 0x01},
    		{0xff, 0x01},
    		{0x80, 0x02},
    	}
    	for _, b := range inputs {
    		x, n := binary.Uvarint(b)
    		if n != len(b) {
    			fmt.Println("Uvarint did not consume all of in")
    		}
    		fmt.Println(x)
    	}
    	// Output:
    	// 1
    	// 2
    	// 127
    	// 128
    	// 255
    	// 256
    }
    
    func ExampleVarint() {
    	inputs := [][]byte{
    		{0x81, 0x01},
    		{0x7f},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 3.2K bytes
    - Viewed (0)
  6. src/cmd/go/internal/modindex/index_format.txt

    Field names refer to fields on RawPackage and rawFile.
    The file uses little endian encoding for the uint32s.
    Strings are written into the string table at the end of the file.
    Each string is prefixed with a uvarint-encoded length.
    Bools are written as uint32s: 0 for false and 1 for true.
    
    The following is the format for a full module:
    
    “go index v2\n”
    str uint32 - offset of string table
    n uint32 - number of packages
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat May 13 00:22:50 UTC 2023
    - 2.4K bytes
    - Viewed (0)
  7. src/cmd/internal/gcprog/gcprog.go

    func (w *Writer) lit(x byte) {
    	if w.nb == progMaxLiteral {
    		w.flushlit()
    	}
    	w.b[w.nb] = x
    	w.nb++
    	w.index++
    }
    
    // varint emits the varint encoding of x.
    func (w *Writer) varint(x int64) {
    	if x < 0 {
    		panic("gcprog: negative varint")
    	}
    	for x >= 0x80 {
    		w.byte(byte(0x80 | x))
    		x >>= 7
    	}
    	w.byte(byte(x))
    }
    
    // flushlit flushes any pending literal bits.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 7.4K bytes
    - Viewed (0)
  8. src/index/suffixarray/suffixarray.go

    func writeInt(w io.Writer, buf []byte, x int) error {
    	binary.PutVarint(buf, int64(x))
    	_, err := w.Write(buf[0:binary.MaxVarintLen64])
    	return err
    }
    
    // readInt reads an int x from r using buf to buffer the read and returns x.
    func readInt(r io.Reader, buf []byte) (int64, error) {
    	_, err := io.ReadFull(r, buf[0:binary.MaxVarintLen64]) // ok to continue with error
    	x, _ := binary.Varint(buf)
    	return x, err
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  9. platforms/software/platform-base/src/main/java/org/gradle/platform/base/Variant.java

    import java.lang.annotation.ElementType;
    import java.lang.annotation.Retention;
    import java.lang.annotation.RetentionPolicy;
    import java.lang.annotation.Target;
    
    /**
     * Declares that a property represents a variant dimension. Variants are used in dependency
     * resolution to discriminate between various binaries that may match the requirements (such
     * as a platform, a build type, ...).
     *
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed Oct 11 12:16:09 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  10. platforms/documentation/docs/src/docs/userguide/img/xctest-variant-task-graph.dot

      compileTestVariantSwift -> linkTestVariant -> installTestVariant -> xcTestVariant [dir=back, style=dashed]
      compileTestVariantSwift[label=<compile<i>Variant</i>Swift>]
      linkTestVariant[label=<link<i>Variant</i>>]
      installTestVariant[label=<installTest<i>Variant</i>>]
      xcTestVariant[label=<xcTest<i>Variant</i>>]
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 1.3K bytes
    - Viewed (0)
Back to top