Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 36 for setstruct (0.23 sec)

  1. src/cmd/cgo/internal/test/test.go

    	*x = 1;
    }
    
    void setintptr(intptr x) {
    	*x = 1;
    }
    
    void setvoidptr(void *x) {
    	*(int*)x = 1;
    }
    
    typedef struct Struct Struct;
    struct Struct {
    	int *P;
    };
    
    void setstruct(Struct s) {
    	*s.P = 1;
    }
    
    // issue 11925
    // Structs with zero-length trailing fields are now padded by the Go compiler.
    
    struct a11925 {
    	int i;
    	char a[0];
    	char b[0];
    };
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 15:50:06 UTC 2024
    - 48.5K bytes
    - Viewed (0)
  2. pkg/typemap/map_test.go

    	typemap.Set[TestInterface[string]](tm, TestStruct{Field: "interface"})
    
    	assert.Equal(t, typemap.Get[int](tm), ptr.Of(1))
    	assert.Equal(t, typemap.Get[int32](tm), ptr.Of(int32(2)))
    	assert.Equal(t, typemap.Get[string](tm), ptr.Of("string"))
    	assert.Equal(t, typemap.Get[*TestStruct](tm), ptr.Of(&TestStruct{Field: "pointer"}))
    	assert.Equal(t, typemap.Get[TestInterface[string]](tm), ptr.Of(TestInterface[string](TestStruct{Field: "interface"})))
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Apr 17 16:38:40 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types/type.go

    	if fieldsHasShape(allParams) {
    		t.SetHasShape(true)
    	}
    
    	return t
    }
    
    // NewStruct returns a new struct with the given fields.
    func NewStruct(fields []*Field) *Type {
    	t := newType(TSTRUCT)
    	t.setFields(fields)
    	if fieldsHasShape(fields) {
    		t.SetHasShape(true)
    	}
    	for _, f := range fields {
    		if f.Type.NotInHeap() {
    			t.SetNotInHeap(true)
    			break
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 49.5K bytes
    - Viewed (0)
  4. pkg/config/model_test.go

    				return c
    			},
    			protocmp.Transform(),
    		},
    		// Random struct pointer
    		{
    			&TestStruct{Name: "foobar"},
    			func(c Spec) Spec {
    				c.(*TestStruct).Name = "bar"
    				return c
    			},
    			nil,
    		},
    		// Random struct
    		{
    			TestStruct{Name: "foobar"},
    			func(c Spec) Spec {
    				x := c.(TestStruct)
    				x.Name = "bar"
    				return x
    			},
    			nil,
    		},
    		// Slice
    		{
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Apr 12 17:37:32 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  5. src/unique/handle_test.go

    	testHandle[testStringStruct](t, testStringStruct{"x"})
    	testHandle[testStringStructArrayStruct](t, testStringStructArrayStruct{
    		s: [2]testStringStruct{testStringStruct{"y"}, testStringStruct{"z"}},
    	})
    	testHandle[testStruct](t, testStruct{0.5, "184"})
    }
    
    func testHandle[T comparable](t *testing.T, value T) {
    	name := reflect.TypeFor[T]().Name()
    	t.Run(fmt.Sprintf("%s/%#v", name, value), func(t *testing.T) {
    		t.Parallel()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 18:14:07 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  6. analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/symbols/KtFirDestructuringDeclarationSymbol.kt

        override val analysisSession: KaFirSession,
    ) : KaDestructuringDeclarationSymbol(), KaFirSymbol<FirVariableSymbol<*>> {
    
        init {
            require(firSymbol.name == SpecialNames.DESTRUCT)
        }
    
        override val psi: KtDestructuringDeclaration
            get() = withValidityAssertion {
                when (val psi = firSymbol.fir.psi) {
                    is KtDestructuringDeclaration -> psi
    Registered: Wed Jun 12 09:53:16 UTC 2024
    - Last Modified: Tue Jun 11 15:45:42 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  7. src/unique/clone_test.go

    	testCloneSeq[testStringArray](t, cSeq(0, 2*goarch.PtrSize, 4*goarch.PtrSize))
    	testCloneSeq[testStringStruct](t, cSeq(0))
    	testCloneSeq[testStringStructArrayStruct](t, cSeq(0, 2*goarch.PtrSize))
    	testCloneSeq[testStruct](t, cSeq(8))
    }
    
    func cSeq(stringOffsets ...uintptr) cloneSeq {
    	return cloneSeq{stringOffsets: stringOffsets}
    }
    
    func testCloneSeq[T any](t *testing.T, want cloneSeq) {
    	typName := reflect.TypeFor[T]().Name()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 18:14:07 UTC 2024
    - 1K bytes
    - Viewed (0)
  8. src/go/types/struct.go

    	tags   []string // field tags; nil if there are no tags
    }
    
    // NewStruct returns a new struct with the given fields and corresponding field tags.
    // If a field with index i has a tag, tags[i] must be that tag, but len(tags) may be
    // only as long as required to hold the tag with the largest index i. Consequently,
    // if no field has a tag, tags may be nil.
    func NewStruct(fields []*Var, tags []string) *Struct {
    	var fset objset
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 29 22:06:18 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  9. analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/symbols/psiBased/KtFe10PsiDestructuringDeclarationSymbol.kt

            KaPsiBasedSymbolPointer.createForSymbolFromSource<KaDestructuringDeclarationSymbol>(this)?.let { return it }
            throw CanNotCreateSymbolPointerForLocalLibraryDeclarationException(SpecialNames.DESTRUCT.asString())
        }
    
        override fun equals(other: Any?): Boolean {
            if (this === other) return true
            return other is KaFe10PsiDestructuringDeclarationSymbol && other.psi == this.psi
        }
    
    Registered: Wed Jun 12 09:53:16 UTC 2024
    - Last Modified: Thu May 23 17:29:30 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/struct.go

    	tags   []string // field tags; nil if there are no tags
    }
    
    // NewStruct returns a new struct with the given fields and corresponding field tags.
    // If a field with index i has a tag, tags[i] must be that tag, but len(tags) may be
    // only as long as required to hold the tag with the largest index i. Consequently,
    // if no field has a tag, tags may be nil.
    func NewStruct(fields []*Var, tags []string) *Struct {
    	var fset objset
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 29 22:06:18 UTC 2024
    - 6.6K bytes
    - Viewed (0)
Back to top