Sponsored Content
Full Discussion: Array alignment on HPUX
Top Forums Programming Array alignment on HPUX Post 302145050 by porter on Monday 12th of November 2007 03:13:58 PM
Old 11-12-2007
Excellent problem!

You will find yourself in a bit of a pickle unless you sort out the misaligned accesses.

If you use structures then the compiler will automatically insert the correct padding to provide the type alignment.

Here are a couple of useful macros

Code:
#define offsetof(x,y)	((long)((char *)&(((x *)0)->y)))
#define alignof(x)	(short)(long)(&((struct { char _x; x _d; } *)NULL)->_d)

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Column Alignment

I copied a word file to my Unix directory, How do I line up my columns to the file I copied over? (3 Replies)
Discussion started by: nikncha
3 Replies

2. Shell Programming and Scripting

alignment of variable

Dear Champs, i have a file let a.txt having value number text 00 123 012 145 456 ...etc i need number and text column vales should right align ??? how can i achive this ??? NOTE number is of max 3 char and text can take max 7 char...so if any records are less than above lengths... (2 Replies)
Discussion started by: manas_ranjan
2 Replies

3. UNIX for Dummies Questions & Answers

VI paste out of alignment

We have a guy at work who is trying to copy and paste from one file to another using vi and highlighting the code to copy with a mouse. Source file: xyz 123 abc 999 zyx 321 cba 999 xyz 123 abc 999 But when he pastes it he gets (I put the underlines in to show... (4 Replies)
Discussion started by: dlam
4 Replies

4. Shell Programming and Scripting

Need Script to Use CPUs on a HPUX server to simulate Workload Manager on HPUX.

I am running HPUX and using WLM (workload manager). I want to write a script to fork CPUs to basically take CPUs from other servers to show that the communication is working and CPU licensing is working. Basically, I want to build a script that will use up CPU on a server. Any ideas? (2 Replies)
Discussion started by: cpolikowsky
2 Replies

5. Shell Programming and Scripting

alignment

Hi, I am having a file with with format. however, for longer xml, the xml code has been truncated like this. F1 |###################### |String1 |<XML><REQ><MSGTYPE>DBDIRECT</MSGTYPE><SYNC>0</SYNC><CLIENT>C11</CLIENT>NAME=MYNAME|JOB=MYJOB| | ... (3 Replies)
Discussion started by: shellwell
3 Replies

6. HP-UX

HP-UX text alignment

HI all, I tried to edit my files using HP-UX but my output tends to not align when I add another character in the files to edit my files i used the command is as follow chmod +w filename vi filename Help, :eek: (1 Reply)
Discussion started by: jasonhpwong
1 Replies

7. HP-UX

pwage-hpux-T for Trusted HPUX servers

I'm sharing this in case anybody needs it. Modified from the original solaris pwage script. This modified hpux script will check /etc/password file on hpux trusted systems search /tcb and grep the required u_succhg field. Calculate days to expiry and notify users via email. original solaris... (2 Replies)
Discussion started by: sparcguy
2 Replies

8. Shell Programming and Scripting

Row alignment

*1 flash read test(*do_test1*) PASS *2 xxxxxxxxxxx flash write test(*do_test2) FAIL ------>xxxxx *1 flash read test(*do_test1*) PASS *2 xxxxxxxxxxx flash write test(*do_test2) FAIL ------>xxxxx I want pass and Fail to be aligned if each line uses printf or echo to print, is... (5 Replies)
Discussion started by: yanglei_fage
5 Replies

9. UNIX for Beginners Questions & Answers

Help with awk alignment

Dear All, I am in the beginning stage of learning shell scripting and preparing shell script on my own now. I would like to get help from fellow mates here. As I am trying to take O/P with space included from I/P table. Kindly guide me to align given I/P table as Expected O/P. ... (5 Replies)
Discussion started by: Raja007
5 Replies
JE::Object::Array(3pm)					User Contributed Perl Documentation				    JE::Object::Array(3pm)

NAME
JE::Object - JavaScript Array object class SYNOPSIS
use JE; use JE::Object::Array; $j = new JE; $js_array = new JE::Object::Array $j, 1, 2, 3; $perl_arrayref = $js_array->value; # returns [1, 2, 3] $js_array->[1]; # same as $js_array->value->[1] "$js_array"; # returns "1,2,3" DESCRIPTION
This module implements JavaScript Array objects. The "@{}" (array ref) operator is overloaded and returns a tied array that you can use to modify the array object itself. The limitations and caveats mentioned in "JE::Object/"USING AN OBJECT AS A HASH"" apply here, too. METHODS
See JE::Types for descriptions of most of the methods. Only what is specific to JE::Object::Array is explained here. $a = JE::Object::Array->new($global_obj, @elements) $a = JE::Object::Array->new($global_obj, $length) $a = JE::Object::Array->new($global_obj, @elements) This creates a new Array object. If the second argument is an unblessed array ref, the elements of that array become the elements of the new array object. If there are two arguments and the second is a JE::Number, a new array is created with that number as the length. Otherwise, all arguments starting from the second one become elements of the new array object. $a->value This returns a reference to an array. This is a copy of the Array object's internal array. If you want an array through which you can modify the object, use @$a. SEE ALSO
JE JE::Types JE::Object perl v5.14.2 2012-03-18 JE::Object::Array(3pm)
All times are GMT -4. The time now is 12:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy