Go Down

Topic: uint_8 or such like (Read 6761 times) previous topic - next topic

drjiohnsmith

I have seen in some code snipets,
   the use of short hand terms , something like

uint_8t in place of unsigned int,

Do we have a list of these some where, and where they are picked up from ?

AWOL

#1
Jul 08, 2012, 08:50 pm Last Edit: Jul 08, 2012, 09:01 pm by AWOL Reason: 1
Quote
uint_8t in place of unsigned int,

No, that would normally be in place of an unsigned char.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

drjiohnsmith

Ok,

but where is the definition of what we have pre defined,
   I could define my own set of abbreviations, in a .h file.

but as we have them somewhere, where are the definitions please ?

how about putting them  into the reference area !

   

dxw00d

http://www.nongnu.org/avr-libc/user-manual/group__avr__stdint.html

drjiohnsmith

thank you

easy when you know where

how do we get this info put in the arduino reference so we can all use it ?

dxw00d

Personally, I think the reference pages should be kept for Arduino specific information, which this isn't.

Quote
easy when you know where

I didn't know where, so I typed 'uint_8t' into Google. Anyone could do that.

westfw

It's a standard C programming thing that goes WAY beyond just Arduino and AVR:
http://en.wikipedia.org/wiki/C_data_types#Fixed_width_integer_types

(It's scary that Arduino and avr-libc pages show up first in google results!)

drjiohnsmith

so your suggesting:

that we don't document unless its arduino specific,
    what about the style guide ?

And as for use google,
   well, thats like saying to my kids when they ask me how to spell a word, look it up in the dictionary.
   I knew from my past that arduino would have a set of abbreviations for unsigned long etc,
       and I wondered what they were,
    why not have it documented in arduino world.

dxw00d

Quote
well, thats like saying to my kids when they ask me how to spell a word, look it up in the dictionary.

What's wrong with that? I was often told that. It increased my vocabulary quite significantly, as I never just looked at the word I wanted to spell, but others around it too. I find it often works the same with Google.

Quote
I knew from my past that arduino would have a set of abbreviations for unsigned long etc,
        and I wondered what they were,
     why not have it documented in arduino world.

It's not 'Arduino' that has a set of abbreviations (although that's not really the right word), it's C. I think it's perfectly reasonable to not have all of C/C++ documented on the Arduino site, when that documentation is so easy to find elsewhere.

drjiohnsmith

dis agree on a fundamental basis.

Arduino is aimed at artists etc, not programmers.
   or so the aims say on the front page.

hence we should make learning as easy as possible , that I guess is  why the guide says dont use pointers.

things like uint_8,
   they are a short cut , but I have seen many different ways of writting them over the decades,
     
so having and documenting a standard that we'd like Arduino code to follow,  to me is a good thing.
 

AWOL

Quote
hence we should make learning as easy as possible

Sometimes, that means not telling someone something, or simplifying.

Remember learning the solar system model of the atom at school, and then, a couple of years later being told it really isn't like that at all?

Quote
things like uint_8,
   they are a short cut

No, they're not - shortcuts are short, and "uint8_t" is longer than "byte".   ;)
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

dxw00d

Quote
dis agree on a fundamental basis.

Nothing wrong with that. We are both entitled to opinions.

I do think that a link to http://cplusplus.com/, or some other appropriate site, should be prominently displayed on the reference page.

drjiohnsmith

re byte ,
   interesting you have to include arduino.h to get byte,
       or include a library that itself points to said.

re c++, interesting that you point to C++,
   Arduino examples are all c based,

OK, YES I know C is a subset of C++. but C++ is a different mind set to C is it not ?

( Hay I was around programming when B was the language, and this C thing was an idea.. )
   

dxw00d

Quote
interesting that you point to C++,
   Arduino examples are all c based,

I only suggested http://cplusplus.com/because I knew the address. That's why I added 'or some other appropriate site'. Perhaps http://www.cprogramming.com/ would be better.

cwrose

Well, I generally avoid byte and word since I don't know what size or sign they are.
OTOH  uint8_t does what it says on the tin - it's an unsigned 8-bit value.  Same
with uint16_t and uint32_t - I'm not sure any further documentation is needed.

Will

Go Up