Skip to content

Commit

Permalink
Merge pull request #10 from asmaloney/spelling
Browse files Browse the repository at this point in the history
Spelling fixes
  • Loading branch information
bbredesen authored Mar 7, 2023
2 parents 68667a6 + a2d7a24 commit 436c370
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
vk-gen is a tool used to create Go bindings for the Vulkan graphics API. It uses the Vulkan XML specification to
generate all type definitions and native function calls for the API. It generates the code for
[go-vk](https://github.com/bbredesen/go-vk), but it can just as well be used to create a modified binding set in your
own projects (for example, excluding certain vendor extensions, incluidng beta extensions, or to generate code from a
own projects (for example, excluding certain vendor extensions, including beta extensions, or to generate code from a
specific version of the Vulkan headers).

## Basic Usage
Expand Down Expand Up @@ -40,7 +40,7 @@ issue/PR will clean this up, but they don't hurt anything at the moment.

* `go:internalSize` - Go has no notion of union types. This field allows you to specify a size for the public
to internal translation result. By default, vk-gen will use the size of the first member in the union, but that is
not neccesarily the largest member. This value must be a string and is copied to an array declaration. It can be
not necessarily the largest member. This value must be a string and is copied to an array declaration. It can be
anything that resolves to a constant in Go, though most typically it will be an integer value (represented as a
string). The value should be the aligned (?) data size in bytes of the largest member of the union.

Expand Down
4 changes: 2 additions & 2 deletions def/command_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func (t *commandType) PrintPublicDeclaration(w io.Writer) {
t.printTrampolineCall(epilogue, funcTrampolineParams, trampolineReturns)
fmt.Fprintln(epilogue)

// If the output requires tranlation, iterate the slice and translate here
// If the output requires translation, iterate the slice and translate here
fmt.Fprintf(epilogue, outputTranslation.String())

}
Expand Down Expand Up @@ -371,7 +371,7 @@ func (t *commandType) PrintPublicDeclaration(w io.Writer) {
fmt.Fprintf(preamble, " %s = make(%s, %s)\n", p.publicName, p.resolvedType.PublicName(), translatedLenMember)
fmt.Fprintf(preamble, " %s := &%s[0]\n", p.internalName, p.publicName)

// At a practical level, this is only used to return an array of handles, we can avoid tranlation altogether; see
// At a practical level, this is only used to return an array of handles, we can avoid translation altogether; see
// AllocateCommandBuffers for an example. It is possible that a future API release will need
// updates here.

Expand Down
2 changes: 1 addition & 1 deletion def/define_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func ReadDefineTypesFromXML(doc *xmlquery.Node, tr TypeRegistry, _ ValueRegistry

var s = unsafe.Sizeof(uintptr(0))

// NewDefineTypeFromXML has a few procesing paths. First, the name is typically
// NewDefineTypeFromXML has a few processing paths. First, the name is typically
// a child node, but is an XML attribute for a few entries. Next, some defines
// such as VK_API_VERSION_1_0 are actually macro calls, which is named in a
// child node for type. Defines may also have a requires attr, which also
Expand Down
2 changes: 1 addition & 1 deletion def/enum_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func NewEnumValueFromXML(td TypeDefiner, elt *xmlquery.Node) *enumValue {
rval.direction = 1
}

// Only applies when an extension is promoted to core, otherwise the Extensioner needs to add the extention number to the value
// Only applies when an extension is promoted to core, otherwise the Extensioner needs to add the extension number to the value
extNumStr := elt.SelectAttr("extnumber")
if extNumStr != "" {
if rval.extNumber, err = strconv.Atoi(extNumStr); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion def/registry_extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func ReadAllExtensionsFromXML(doc *xmlquery.Node, tr TypeRegistry, vr ValueRegis
}

// Enum values are actually defined in the extension, though they may be re-defined or partially defined
// elsehwere if the extension was promoted to core. Add the value name, plus create the ValueDefiner and put
// elsewhere if the extension was promoted to core. Add the value name, plus create the ValueDefiner and put
// it in the registry.
for _, enumNode := range xmlquery.Find(reqNode, "/enum") {
// Also, bitmasks and values with offsets are defined in the same place, so first figure out which type
Expand Down
4 changes: 2 additions & 2 deletions def/struct_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func (m *structMember) PrintInternalDeclaration(w io.Writer) {
// struct and directly assign it to the output struct
// 3) Embedded structs - we can Vulkanize and dereference the embedded struct in
// the output struct declaration.
// 4) Slices of "IsIdential..." types - assign the address of the 0 element.
// 4) Slices of "IsIdentical..." types - assign the address of the 0 element.
// 5) Slices of non-"IsIdentical..." types - build a temporary slice of the
// translated values, and then assign the 0-address as above.
// 6) Length fields - Array pointers have an associated length member in the
Expand Down Expand Up @@ -379,7 +379,7 @@ func (m *structMember) PrintGoifyContent(preamble, structDecl, epilogue io.Write

case m.isLenForOtherMember != nil: // Edge case 6 happens, but is not identified in vk.xml.
// Example: VkPhysicalDeviceMemoryProperties has two fixed length
// arrays, each of which has an associated lenght member to indicate how
// arrays, each of which has an associated length member to indicate how
// many values were returned. The XML file does not link those fields
// via "len" on the arrays. You could probably infer the information
// because the member names are (e.g.) memoryTypeCount and memoryTypes.
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func printCategory(tc def.TypeCategory, fc *feat.Feature, platform *feat.Platfor
outpath := fmt.Sprintf("%s/%s", outDirName, filename+".go")

f, _ := os.Create(outpath)
// explict f.Close() below; not defered because the file must be written to disk before goimports is run
// explicit f.Close() below; not deferred because the file must be written to disk before goimports is run

if platform != nil && platform.GoBuildTag != "" {
fmt.Fprintf(f, "//go:build %s\n", platform.GoBuildTag)
Expand Down Expand Up @@ -400,7 +400,7 @@ func copyStaticFiles() {
logrus.Info("Copying static files")
source := "static_include"

// Naieve solution from https://stackoverflow.com/questions/51779243/copy-a-folder-in-go
// Naive solution from https://stackoverflow.com/questions/51779243/copy-a-folder-in-go
var err error = filepath.Walk(source, func(path string, info os.FileInfo, err error) error {
var relPath string = strings.Replace(path, source, "", 1)
if relPath == "" {
Expand Down

0 comments on commit 436c370

Please sign in to comment.