diff options
author | joerg <joerg@pkgsrc.org> | 2016-05-18 20:18:31 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2016-05-18 20:18:31 +0000 |
commit | 7963c7427d78361041456d050436ce33b8514aa2 (patch) | |
tree | ed1c53ebb1700cce24a2bb215163cebc652a3a69 /cross | |
parent | a687b65683cbd25587e4fd90bd7600cecb093e36 (diff) | |
download | pkgsrc-7963c7427d78361041456d050436ce33b8514aa2.tar.gz |
Under C++11 it is invalid to implicitly cast from a larger type to a
smaller type in an initializer. Adjust various places accordingly.
Avoid set-but-not-used warnings in some other places for newer GCC.
Diffstat (limited to 'cross')
-rw-r--r-- | cross/uisp/distinfo | 6 | ||||
-rw-r--r-- | cross/uisp/patches/patch-src_AvrAtmel.C | 40 | ||||
-rw-r--r-- | cross/uisp/patches/patch-src_AvrDummy.C | 37 | ||||
-rw-r--r-- | cross/uisp/patches/patch-src_Stk500.C | 47 |
4 files changed, 125 insertions, 5 deletions
diff --git a/cross/uisp/distinfo b/cross/uisp/distinfo index 186e4de79ef..d4e23f4358a 100644 --- a/cross/uisp/distinfo +++ b/cross/uisp/distinfo @@ -1,11 +1,13 @@ -$NetBSD: distinfo,v 1.6 2015/11/03 00:47:45 agc Exp $ +$NetBSD: distinfo,v 1.7 2016/05/18 20:18:31 joerg Exp $ SHA1 (uisp-20040311.tar.bz2) = 8e4c1e05d2f9a962b8969fc76d8b448c9e0751d4 RMD160 (uisp-20040311.tar.bz2) = 4f45d375e942376a2508232cf787f94ab7f8995b SHA512 (uisp-20040311.tar.bz2) = 53af07f6555f0df62cb56571b0e87dba3bf88084d079ada9a4d37fed99cf460dd108bdc79e18940cc2752df7b0db0532630494a35cf12ebc8c8e7191e3452b65 Size (uisp-20040311.tar.bz2) = 142973 bytes SHA1 (patch-aa) = 60d42fc897b8c77c8396823fd9b26b95adb68a77 +SHA1 (patch-src_AvrAtmel.C) = 39ce04beeb854fafc5180fd47ff1b1d379da381e +SHA1 (patch-src_AvrDummy.C) = 340137064aa8482799b00cefaaa58dd2bdb70563 SHA1 (patch-src_MotIntl.C) = 456a47463f81da901c78822dc26e9e7683ac5b61 -SHA1 (patch-src_Stk500.C) = a2881e5e0591dc2efb58fa9bd6b84b8327f54b0e +SHA1 (patch-src_Stk500.C) = 1444daeb1970b8e346ecad549071de478e1e1d6d SHA1 (patch-src_avr_h) = f5ac07e1a8e3865e7c6bd3af86a1777bb068b5fd SHA1 (patch-src_dapa_c) = bc3fd2ecde373af2a2a3864f07efedd1177ecca0 diff --git a/cross/uisp/patches/patch-src_AvrAtmel.C b/cross/uisp/patches/patch-src_AvrAtmel.C new file mode 100644 index 00000000000..92d17a4edd5 --- /dev/null +++ b/cross/uisp/patches/patch-src_AvrAtmel.C @@ -0,0 +1,40 @@ +$NetBSD: patch-src_AvrAtmel.C,v 1.1 2016/05/18 20:18:32 joerg Exp $ + +--- src/AvrAtmel.C.orig 2016-05-18 12:28:24.000000000 +0000 ++++ src/AvrAtmel.C +@@ -185,7 +185,7 @@ void TAvrAtmel::EnableAvr(){ + + void TAvrAtmel::SetAddress(TAddr addr){ + apc_address = addr; +- TByte setAddr [3] = { 'A', (addr>>8)&0xff, addr&0xff}; ++ TByte setAddr [3] = { 'A', TByte((addr>>8)&0xff), TByte(addr&0xff)}; + Send(setAddr, 3, 1); + CheckResponse(setAddr [0]); + } +@@ -294,7 +294,7 @@ void TAvrAtmel::WriteByte(TAddr addr, TB + if (flush_buffer){WriteProgramMemoryPage();} + } + +- TByte wrF [2] = { (addr&1)?'C':'c', byte }; ++ TByte wrF [2] = { TByte((addr&1)?'C':'c'), byte }; + + if (apc_address!=(addr>>1) || apc_autoinc==false) SetAddress (addr>>1); + if (wrF[0]=='C') apc_address++; +@@ -346,7 +346,7 @@ void TAvrAtmel::WriteByte(TAddr addr, TB + */ + void TAvrAtmel::WriteOldFuseBits (TByte val) + { +- TByte buf[5] = {'.', 0xac, (val & 0x1f) | 0xa0, 0x00, 0xd2 }; ++ TByte buf[5] = {'.', 0xac, TByte((val & 0x1f) | 0xa0), 0x00, 0xd2 }; + Info (2, "Write fuse high bits: %02x\n", (int)val); + Send (buf, 5, 2); + CheckResponse (buf[1]); +@@ -423,7 +423,7 @@ void TAvrAtmel::ChipErase(){ + } + + void TAvrAtmel::WriteLockBits(TByte bits){ +- TByte lockTarget [2] = { 'l', 0xF9 | ((bits << 1) & 0x06) }; ++ TByte lockTarget [2] = { 'l', TByte(0xF9 | ((bits << 1) & 0x06)) }; + Send (lockTarget, 2, 1); + CheckResponse(lockTarget [0]); + Info(1, "Writing lock bits ...\nReinitializing device\n"); diff --git a/cross/uisp/patches/patch-src_AvrDummy.C b/cross/uisp/patches/patch-src_AvrDummy.C new file mode 100644 index 00000000000..d736d560078 --- /dev/null +++ b/cross/uisp/patches/patch-src_AvrDummy.C @@ -0,0 +1,37 @@ +$NetBSD: patch-src_AvrDummy.C,v 1.1 2016/05/18 20:18:32 joerg Exp $ + +--- src/AvrDummy.C.orig 2016-05-18 12:26:28.000000000 +0000 ++++ src/AvrDummy.C +@@ -81,12 +81,12 @@ TByte + TAvrDummy::GetPartInfo(TAddr addr) + { + if (at89) { +- TByte info [4] = { 0x28, addr & 0x1f, 0, 0 }; ++ TByte info [4] = { 0x28, TByte(addr & 0x1f), 0, 0 }; + Send(info, 4); + return info[3]; + } + +- TByte info [4] = { 0x30, 0, addr, 0 }; ++ TByte info [4] = { 0x30, 0, TByte(addr), 0 }; + Send(info, 4); + return info[3]; + } +@@ -289,7 +289,7 @@ TAvrDummy::ReadCalByte(TByte addr) + void + TAvrDummy::WriteOldFuseBits(TByte val) + { +- TByte oldfuse[4] = { 0xAC, (val & 0x1F) | 0xA0, 0, 0xD2 }; ++ TByte oldfuse[4] = { 0xAC, TByte((val & 0x1F) | 0xA0), 0, 0xD2 }; + Send(oldfuse, 4); + } + +@@ -532,7 +532,7 @@ TAvrDummy::WriteLockBits(TByte bits) + { + /* This handles both old (byte 2, bits 1-2) + and new (byte 4, bits 0-5) devices. */ +- TByte lock[4] = { 0xAC, 0xF9 | ((bits << 1) & 0x06), 0xFF, bits }; ++ TByte lock[4] = { 0xAC, TByte(0xF9 | ((bits << 1) & 0x06)), 0xFF, bits }; + TByte rbits; + + if (at89) diff --git a/cross/uisp/patches/patch-src_Stk500.C b/cross/uisp/patches/patch-src_Stk500.C index c039b0fcfde..ecf806ea91d 100644 --- a/cross/uisp/patches/patch-src_Stk500.C +++ b/cross/uisp/patches/patch-src_Stk500.C @@ -1,8 +1,16 @@ -$NetBSD: patch-src_Stk500.C,v 1.1 2011/12/05 22:44:08 joerg Exp $ +$NetBSD: patch-src_Stk500.C,v 1.2 2016/05/18 20:18:32 joerg Exp $ ---- src/Stk500.C.orig 2011-12-05 20:37:56.000000000 +0000 +--- src/Stk500.C.orig 2004-02-07 19:12:33.000000000 +0000 +++ src/Stk500.C -@@ -407,7 +407,7 @@ void TStk500::FlushWriteBuffer(){ +@@ -393,7 +393,6 @@ void TStk500::WriteByte(TAddr addr, TByt + void TStk500::FlushWriteBuffer(){ + TByte buf[0x200]; + int wordsize; +- TAddr addr; + TByte seg; + const TByte *pgsz; + int pagesize; +@@ -407,7 +406,7 @@ void TStk500::FlushWriteBuffer(){ } pgsz = prg_part[desired_part].params.pagesize; @@ -11,3 +19,36 @@ $NetBSD: patch-src_Stk500.C,v 1.1 2011/12/05 22:44:08 joerg Exp $ if (pagesize == 0) { pagesize = 128; +@@ -415,7 +414,6 @@ void TStk500::FlushWriteBuffer(){ + + EnterProgrammingMode(); + +- addr = 0; + for (unsigned int addr=0; addr<maxaddr; addr+=pagesize) { + memcpy(buf, SetAddress, sizeof(SetAddress)); + buf[1] = (addr/wordsize) & 0xff; +@@ -506,7 +504,7 @@ TByte TStk500::ReadLockBits() + + TByte TStk500::ReadCalFuseBits(int addr) + { +- TByte cmd[] = { 0x38, 0x00, addr, 0x00 }; ++ TByte cmd[] = { 0x38, 0x00, TByte(addr), 0x00 }; + + return UniversalCmd(cmd); + } +@@ -712,7 +710,6 @@ void TStk500::ReadSignature() { + void TStk500::ReadMem(){ + TByte buf[0x200]; + int wordsize; +- TAddr addr; + TByte seg; + + if (segment == SEG_FLASH) { +@@ -729,7 +726,6 @@ void TStk500::ReadMem(){ + + EnterProgrammingMode(); + +- addr = 0; + for (unsigned int addr=0; addr<GetSegmentSize(); addr+=0x100) { + memcpy(buf, SetAddress, sizeof(SetAddress)); + buf[1] = (addr/wordsize) & 0xff; |