|
Namazu for hns による簡易全文検索 詳しくは 詳細指定/ヘルプを参照して下さい |
|||||||||||||||||||||||||||||||||||||||||||||||||
2002年08月19日(月) 旧暦 [n年日記]#1 [C] union 練習
以前に教えてもらったもの (
すれば出て来る )
が、そのままでは cc 出来なかったので、直して見て練習。
#include <stdio.h>
struct buf {
int data;
};
union ubuffer {
struct buf left;
unsigned short right[sizeof(struct buf)/sizeof(short)];
};
bug(m)
struct buf *m;
{
int sum = 0;
union ubuffer w;
bzero(&w.left, sizeof w.left);
w.left.data = m->data;
sum += w.right[0];
sum += w.right[1];
printf("sum = 0x%x\n", sum);
return 0;
}
main()
{
struct buf m;
m.data = 0x12345678;
bug(&m);
}
ttyr7:makoto@u 7:55:42/020819(~/c)> cc -o union union.c ( つっこみ )
#2 [NetBSD] adb_direct.c
の変更を
port-powerpc-ja に書いたけれど、
toolchain/16678
に出ていた。
`-fgcse' Perform a global common subexpression elimination pass. This pass also performs global constant and copy propagation. ( つっこみ )
#3 [NetBSD] macppc/snapshot/20020817ts
macppc-020817.tar.gz の形が少し変っていて、src で開ける。
/checkflist 1220d1219 < ./usr/include/macppc/pmc.h 1558d1556 < ./usr/include/powerpc/atomic.h 1588d1585 < ./usr/include/powerpc/pmc.h 5766.844u 2026.927s 2:37:20.22 82.5% 0+0k 23751+424711io 9534pf+0w上で言われたことだけ直して、 DESTDIR, RELEASEDIR, NETBSDSRCDIR を設定して ( cd 20020817/distrib/sets ; /export/current-ts/20020817/tools/obj/tools.NetBSD-1.6E-powerpc/bin/nbmake sets )すると、もっと沢山言われてしまう。MACHINE=macppc MACHINE_ARCH=powerpc を設定すると、解決。 NetBSD quick 1.6F NetBSD 1.6F (GENERIC) #2: Mon Aug 19 10:00:57 JST 2002 root@quick:/export/current-ts/20020817/obj/sys/arch/macppc/compile/GENERIC macppcという訳で、kernel は動いている。けふはこのやうなことをするはずではなかったが。 ( つっこみ )
#4 [無題]sh -c /bin/csh -cf 'set nonomatch; glob [1-8]*.index*' 2>/dev/null (perl)/これってどういう意味かなぁ。 (単に perl が shell 手続を起動しているだけらしい) ( つっこみ )
|
最近の日記 2026年02月28日 ・my first script-fu 2026年01月29日 ・Die Fledermaus at New National theatre 2026/01/29 2025年12月25日 ・pbulk 11.99.3 (emacs30) 2025年11月22日 ・crash dump 2025年10月25日 ・recover from disk error | ||