1
0
mirror of https://github.com/wfjm/w11.git synced 2026-03-29 11:25:50 +00:00

comment&code cosmetics; minor changes

This commit is contained in:
wfjm
2018-11-03 10:30:00 +01:00
parent 6a09d0db92
commit 0913863793
5 changed files with 21 additions and 20 deletions

View File

@@ -136,26 +136,24 @@ The details are described in
#### <a id="build-cpp">Compile sharable libraries</a>
Note: some `c++11` features are used in the code
| Feature | Description | in gcc since |
| :------ | :---------- | :----------: |
| N2343 | decltype (used by boost bind) | gcc 4.3 |
| N2431 | nullptr | gcc 4.6 |
| N2930 | range based for | gcc 4.6 |
| N1984 | auto-types variables | gcc 4.4 |
The backend code base uses now many `c++11` langauge features, e.g.
`nullptr`, `auto`, lambda functions, list initialization, range-based `for`,
to name the most prominent.
A C++ compiler with full `c++11` support is therefore needed, so either
`gcc 4.8.1` or `clang 3.3`. Current experience is:
- gcc 5.4.0 and clang 3.8.0, as in Ubuntu 16.04 LTS, _will work !!_
- gcc 4.7.2 and clang 3.0-6.2, as in Debian 7, _will not work !!_
Required tools and libraries:
g++ >= 4.6 (see c++11 usage above)
g++ >= 4.8.1 (see c++11 usage above)
boost >= 1.35 (boost::thread api changed, new one is used)
linusb >= 1.0.5 (timerfd support)
libusb >= 1.0.5 (timerfd support)
Build was tested under:
ubuntu xenial (16.04 LTS): gcc 5.4.0 boost 1.58 libusb 1.0.20
ubuntu trusty (14.04 LTS): gcc 4.8.2 boost 1.54 libusb 1.0.17
debian wheezy (7.0.8): gcc 4.7.2 boost 1.49 libusb 1.0.11
To build all sharable libraries

1
rtl/bplib/nexys4d/tb/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
tb_nexys4d_dummy

View File

@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# $Id: create_disk 985 2018-01-03 08:59:40Z mueller $
# $Id: create_disk 1059 2018-10-27 10:34:16Z mueller $
#
# Copyright 2013-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
# Copyright 2013-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
#
# This program is free software; you may redistribute and/or modify it under
# the terms of the GNU General Public License as published by the Free
@@ -247,7 +247,7 @@ sub print_help {
my ($ptyp) = @_;
print "usage: create_disk [options] <file>\n";
print " --typ=<type> specified disk type, must be specified\n";
print " --ini=<pat> initialization pattern, can be\n";
print " --ini=<pat> initialization pattern, available patterns below\n";
print " --bad create factory bad block table on last track\n";
print " --boot write dummy boot block, print volume info and HALT\n";
print " --help print full help, with list --typ and --ini options\n";

View File

@@ -1,6 +1,6 @@
// $Id: RlinkPortFifo.cpp 983 2018-01-02 20:35:59Z mueller $
// $Id: RlinkPortFifo.cpp 1063 2018-10-29 18:37:42Z mueller $
//
// Copyright 2011-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2011-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -95,7 +95,7 @@ int RlinkPortFifo::OpenFifo(const std::string& name, bool snd, RerrMsg& emsg)
int irc;
irc = stat(name.c_str(), &stat_fifo);
irc = ::stat(name.c_str(), &stat_fifo);
if (irc == 0) {
if ((stat_fifo.st_mode & S_IFIFO) == 0) {
emsg.Init("RlinkPortFifo::OpenFiFo()",
@@ -112,7 +112,8 @@ int RlinkPortFifo::OpenFifo(const std::string& name, bool snd, RerrMsg& emsg)
return -1;
}
}
/* coverity[toctou] */
irc = ::open(name.c_str(), snd ? O_WRONLY : O_RDONLY);
if (irc < 0) {
emsg.InitErrno("RlinkPortFifo::OpenFifo()",

View File

@@ -1,4 +1,4 @@
// $Id: Rtools.cpp 1059 2018-10-27 10:34:16Z mueller $
// $Id: Rtools.cpp 1063 2018-10-29 18:37:42Z mueller $
//
// Copyright 2011-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -122,7 +122,7 @@ bool CreateBackupFile(const std::string& fname, size_t nbackup, RerrMsg& emsg)
fnames.push_back(fname);
for (size_t i=1; i<=nbackup; i++) {
char fnum[4];
snprintf(fnum, 4, "%d", (int)i);
::snprintf(fnum, sizeof(fnum), "%d", (int)i);
fnames.push_back(fbase + "_" + fnum + fext);
}
@@ -144,6 +144,7 @@ bool CreateBackupFile(const std::string& fname, size_t nbackup, RerrMsg& emsg)
return false;
}
// here we know old file exists and is a regular file
/* coverity[toctou] */
irc = ::rename(fnam_old.c_str(), fnam_new.c_str());
if (irc < 0) {
emsg.InitErrno("Rtools::CreateBackupFile",