Sponsored Content
Full Discussion: Unsigned int
Top Forums Programming Unsigned int Post 16506 by Perderabo on Sunday 3rd of March 2002 02:38:53 AM
Old 03-03-2002
On HP-UX, this program works:
Code:
#include<stdlib.h>
#include<stdio.h>
main()
{
         long i;
         i=5000000000;
         printf("i = %ld \n", i);
          exit (0);
}

To get this to work I had to specify the +DD64 option on the cc command. HP's compiler defaults to 32 bit mode.

This page says:
Quote:
The HP-UX 64-bit data model is called LP64 because longs and pointers are 64 bits. In this model, ints remain 32 bits.

The LP64 data model is the emerging standard on 64-bit UNIX systems provided by leading system vendors. Applications that transition to the LP64 data model on HP-UX systems are highly portable to other LP64 vendor platforms.
 

10 More Discussions You Might Find Interesting

1. Programming

difference between int ** func() and int *& func()

What is the difference between int** func() and int*& func(). Can you please explain it with suitable example. Thanks, Devesh. (1 Reply)
Discussion started by: devesh
1 Replies

2. Programming

to get the correct value with unsigned int

hi, Please help me with the following code to get the difference in values. struct a{ int b1; int c1; char d1; } main() { unsigned int b=10; unsigned int c; c = b - (unsigned int )sizeof(a); printf("%d",c); } Here c returns some junk value. How can i get the... (2 Replies)
Discussion started by: naan
2 Replies

3. UNIX for Dummies Questions & Answers

int open(const char *pathname, int flags, mode_t mode) doubt...

hello everybody! I want to create a file with permissions for read, write, and execute to everybody using C, so I write this code: #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int main(){ int fileDescriptor; fileDescriptor =... (2 Replies)
Discussion started by: csnmgeek
2 Replies

4. Red Hat

cast from const void* to unsigned int loses precision

Hello everey one, here i am attempting to compile a c++ project .it's throughing the following errors. my machine details are as follows: Linux chmclozr0119 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:19 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux errors: ===== Generating... (0 Replies)
Discussion started by: mannam srinivas
0 Replies

5. Programming

Handle int listen(int sockfd, int backlog) in TCP

Hi, from the manual listen(2): listen for connections on socket - Linux man page It has a parameter called backlog and it limits the maximum length of queue of pending list. If I set backlog to 128, is it means no more than 128 packets can be handled by server? If I have three... (3 Replies)
Discussion started by: sehang
3 Replies

6. Programming

Help with understanding ( int, char, long, short, signed, unsigned etc.... )

My question is simple: When should I use a long, int, char, unsigned/signed variables?? When I declare a variable "unsigned;" what did I do it??? Why would I delcare an integer "long" or "short" ( unsigned or signed)?? Any examples of when things like "unsigned", "long", "short" etc...... (6 Replies)
Discussion started by: cpp_beginner
6 Replies

7. Programming

Comparing unsigned char bits.

/******************************************************************************/ /* Printing an unsigned character in bits */ #include <stdio.h> void display_bits ( unsigned char ); int main() { unsigned char x; /*... (15 Replies)
Discussion started by: robin_simple
15 Replies

8. Programming

Signed and unsigned intergers

when a date type is considered signed and unsigned is that simple referring to - for signed and positive numbers for unsigned? Further if that is the case would mutiplying and dividing ect where 2 signed numbers, like (-2)*(-2) = 4 result in a unsigned. (3 Replies)
Discussion started by: Fingerz
3 Replies

9. Programming

Unable to assign zero to unsigned character array

Hi, I am unable to assign value zero to my variable which is defined as unsigned char. typedef struct ABCD { unsigned char abc; unsigned char def; unsigned char ghi; } ABCD; typedef ABCD *PABCD; In my Por*C code, i assign the values using memcpy like below ... (3 Replies)
Discussion started by: gthangav
3 Replies

10. OS X (Apple)

Unsigned to signed, error?...

Hi guys... Macbook Pro, 13", circa August 2012, OSX 10.7.5, default bash terminal. I require the capability to convert +32767 to -32768 into signed hex words... The example piece code below works perfectly except... #/bin/bash # sign.sh # Unsign to sign... while true do # I have used... (2 Replies)
Discussion started by: wisecracker
2 Replies
ddi_model_convert_from(9F)				   Kernel Functions for Drivers 				ddi_model_convert_from(9F)

NAME
ddi_model_convert_from - determine data model type mismatch SYNOPSIS
#include <sys/ddi.h> #include <sys/sunddi.h> uint_tddi_model_convert_from(uint_t model); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
model The data model type of the current thread. DESCRIPTION
ddi_model_convert_from() is used to determine if the current thread uses a different C Language Type Model than the device driver. The 64-bit version of Solaris will require a 64-bit kernel to support both 64-bit and 32-bit user mode programs. The difference between a 32-bit program and a 64-bit program is in its C Language Type Model: a 32-bit program is ILP32 (integer, longs, and pointers are 32-bit) and a 64-bit program is LP64 (longs and pointers are 64-bit). There are a number of driver entry points such as ioctl(9E) and mmap(9E) where it is necessary to identify the C Language Type Model of the user-mode originator of an kernel event. For example any data which flows between programs and the device driver or vice versa need to be identical in format. A 64-bit device driver may need to modify the format of the data before sending it to a 32-bit application. ddi_model_convert_from() is used to determine if data that is passed between the device driver and the application requires reformatting to any non-native data model. RETURN VALUES
DDI_MODEL_ILP32 A conversion to/from ILP32 is necessary. DDI_MODEL_NONE No conversion is necessary. Current thread and driver use the same data model. CONTEXT
ddi_model_convert_from() can be called from any context. EXAMPLES
Example 1 : Using ddi_model_convert_from() in the ioctl() entry point to support both 32-bit and 64-bit applications. The following is an example how to use ddi_model_convert_from() in the ioctl() entry point to support both 32-bit and 64-bit applications. struct passargs32 { int len; caddr32_t addr; }; struct passargs { int len; caddr_t addr; }; xxioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, int *rvalp) { struct passargs pa; switch (ddi_model_convert_from(mode & FMODELS)) { case DDI_MODEL_ILP32: { struct passargs32 pa32; ddi_copyin(arg, &pa32, sizeof (struct passargs32), mode); pa.len = pa32.len; pa.address = pa32.address; break; } case DDI_MODEL_NONE: ddi_copyin(arg, &pa, sizeof (struct passargs), mode); break; } do_ioctl(&pa); .... } SEE ALSO
ioctl(9E), mmap(9E), ddi_mmap_get_model(9F) Writing Device Drivers SunOS 5.11 8 Feb 2001 ddi_model_convert_from(9F)
All times are GMT -4. The time now is 11:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy