Pages: [1] 2 3   Go Down
Author Topic: uint_8 or such like  (Read 6327 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 4
Posts: 327
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26620
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
uint_8t in place of unsigned int,
No, that would normally be in place of an unsigned char.
« Last Edit: July 08, 2012, 02:01:59 pm by AWOL » Logged

"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.

Offline Offline
Sr. Member
****
Karma: 4
Posts: 327
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 !

     
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Sr. Member
****
Karma: 4
Posts: 327
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thank you

easy when you know where

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

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6805
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!)
Logged

Offline Offline
Sr. Member
****
Karma: 4
Posts: 327
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Sr. Member
****
Karma: 4
Posts: 327
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
   
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26620
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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".   smiley-wink
Logged

"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.

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Sr. Member
****
Karma: 4
Posts: 327
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.. )
     
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 55
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1] 2 3   Go Up
Jump to: