-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Str returns *int8 #47
Comments
That sounds like a valid point. |
I would guess the problem is more complex than that. I use I am not sure why this is exactly. |
Maybe it's easier to modify var L int32
gl.GetShaderiv(object, gl.INFO_LOG_LENGTH, &L)
if L > 1 {
buff := make([]int8, L)
gl.GetShaderInfoLog(object, L, &L, &buff[0])
println(gl.GoStr(&buff[0]))
} |
We should go in the more correct direction, rather one that's easier to modify (in case the two don't match). It seems
Given that it's meant to deal with strings, I think Go's |
The challenge is that I'm marginally in favour of making the switch.
For historical reference |
I believe the only other normal use in C of the |
In c char, signed char and unsigned char are different types. ;) |
http://gcc.gnu.org/onlinedocs/gcc-4.6.1/gcc/C-Dialect-Options.html |
Use uint8 for GLchar and GLcharARB. Fix #47.
So it is a |
http://golang.org/ref/spec#Numeric_types EDIT: submitted early on accident. |
We prefer uint8 over byte because some GL functions, such as glGetString, use GLubyte rather than GLchar. |
@errcw Is there a typo in your post? It doesn't make sense. In Go, |
Even if byte and uint8 represent the same type I wanted to unify the same declared type wherever possible, hence choosing uint8. |
That makes sense. :) |
Bah misclicked. |
That sounds like the perfect use for |
I don't disagree. Most Go funcs in standard library use This is completely a human presentation difference. The two types are completely identical and interchangeable. The Go code cannot tell them apart, because, as soon as it enters the compiler and loses its human readable type name, there's only one underlying type. http://play.golang.org/p/vCBcvzXzyr You could change a library's func signature from |
It is a problem. In my binding generator I wrote a set of complicated rules to determine if something was a c string or just a byte array. It would be better to get them to fix the xml though. |
I agree we could have easily chosen |
I also chose uint8 for that exact reason, int8 and uint8. |
GoStr
receives an*uint8
, shouldn'tStr
return an*uint8
too?The text was updated successfully, but these errors were encountered: