Mercurial > octave
changeset 23798:771310737137
Use C++11 nullptr rather than 0 in code (bug #51565).
* oct-errno.in.cc: Replace 0 with nullptr for final entry of errno_codes[].
Remove extra comma from definitions of errno_struct.
* mk-errno-list.sh: Stop printing extra comma in errno output.
* oct-parse.in.yy, fCMatrix.cc:
Use C++11 nullptr rather than 0 in code
author | Rik <rik@octave.org> |
---|---|
date | Thu, 27 Jul 2017 08:32:17 -0700 |
parents | 755b4c622972 |
children | 964843643377 |
files | libinterp/corefcn/mk-errno-list.sh libinterp/corefcn/oct-errno.in.cc libinterp/parse-tree/oct-parse.in.yy liboctave/array/fCMatrix.cc |
diffstat | 4 files changed, 80 insertions(+), 80 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/mk-errno-list.sh Wed Jul 26 21:09:19 2017 -0700 +++ b/libinterp/corefcn/mk-errno-list.sh Thu Jul 27 08:32:17 2017 -0700 @@ -26,7 +26,7 @@ if [ $1 = "--perl" ]; then PERL="$2" $PERL -e 'foreach $key (sort (keys (%!))) { - $x .= "#if defined ($key)\n { \"$key\", $key, },\n#endif\n"; + $x .= "#if defined ($key)\n { \"$key\", $key },\n#endif\n"; } while (<>) { s/^ *\@SYSDEP_ERRNO_LIST\@/$x/; @@ -40,7 +40,7 @@ from errno import errorcode from sys import stdin, stdout -t = "#if defined (%s)\n { \"%s\", %s, },\n#endif\n" +t = "#if defined (%s)\n { \"%s\", %s },\n#endif\n" errstr = "" for v in sorted (errorcode.values ()): errstr += t % tuple (3 * [v])
--- a/libinterp/corefcn/oct-errno.in.cc Wed Jul 26 21:09:19 2017 -0700 +++ b/libinterp/corefcn/oct-errno.in.cc Thu Jul 27 08:32:17 2017 -0700 @@ -48,233 +48,233 @@ // POSIX. #if defined (E2BIG) - { "E2BIG", E2BIG, }, + { "E2BIG", E2BIG }, #endif #if defined (EACCES) - { "EACCES", EACCES, }, + { "EACCES", EACCES }, #endif #if defined (EADDRINUSE) - { "EADDRINUSE", EADDRINUSE, }, + { "EADDRINUSE", EADDRINUSE }, #endif #if defined (EADDRNOTAVAIL) - { "EADDRNOTAVAIL", EADDRNOTAVAIL, }, + { "EADDRNOTAVAIL", EADDRNOTAVAIL }, #endif #if defined (EAFNOSUPPORT) - { "EAFNOSUPPORT", EAFNOSUPPORT, }, + { "EAFNOSUPPORT", EAFNOSUPPORT }, #endif #if defined (EAGAIN) - { "EAGAIN", EAGAIN, }, + { "EAGAIN", EAGAIN }, #endif #if defined (EALREADY) - { "EALREADY", EALREADY, }, + { "EALREADY", EALREADY }, #endif #if defined (EBADF) - { "EBADF", EBADF, }, + { "EBADF", EBADF }, #endif #if defined (EBUSY) - { "EBUSY", EBUSY, }, + { "EBUSY", EBUSY }, #endif #if defined (ECHILD) - { "ECHILD", ECHILD, }, + { "ECHILD", ECHILD }, #endif #if defined (ECONNABORTED) - { "ECONNABORTED", ECONNABORTED, }, + { "ECONNABORTED", ECONNABORTED }, #endif #if defined (ECONNREFUSED) - { "ECONNREFUSED", ECONNREFUSED, }, + { "ECONNREFUSED", ECONNREFUSED }, #endif #if defined (ECONNRESET) - { "ECONNRESET", ECONNRESET, }, + { "ECONNRESET", ECONNRESET }, #endif #if defined (EDEADLK) - { "EDEADLK", EDEADLK, }, + { "EDEADLK", EDEADLK }, #endif #if defined (EDESTADDRREQ) - { "EDESTADDRREQ", EDESTADDRREQ, }, + { "EDESTADDRREQ", EDESTADDRREQ }, #endif #if defined (EDOM) - { "EDOM", EDOM, }, + { "EDOM", EDOM }, #endif #if defined (EDQUOT) - { "EDQUOT", EDQUOT, }, + { "EDQUOT", EDQUOT }, #endif #if defined (EEXIST) - { "EEXIST", EEXIST, }, + { "EEXIST", EEXIST }, #endif #if defined (EFAULT) - { "EFAULT", EFAULT, }, + { "EFAULT", EFAULT }, #endif #if defined (EFBIG) - { "EFBIG", EFBIG, }, + { "EFBIG", EFBIG }, #endif #if defined (EHOSTDOWN) - { "EHOSTDOWN", EHOSTDOWN, }, + { "EHOSTDOWN", EHOSTDOWN }, #endif #if defined (EHOSTUNREACH) - { "EHOSTUNREACH", EHOSTUNREACH, }, + { "EHOSTUNREACH", EHOSTUNREACH }, #endif #if defined (EINPROGRESS) - { "EINPROGRESS", EINPROGRESS, }, + { "EINPROGRESS", EINPROGRESS }, #endif #if defined (EINTR) - { "EINTR", EINTR, }, + { "EINTR", EINTR }, #endif #if defined (EINVAL) - { "EINVAL", EINVAL, }, + { "EINVAL", EINVAL }, #endif #if defined (EIO) - { "EIO", EIO, }, + { "EIO", EIO }, #endif #if defined (EISCONN) - { "EISCONN", EISCONN, }, + { "EISCONN", EISCONN }, #endif #if defined (EISDIR) - { "EISDIR", EISDIR, }, + { "EISDIR", EISDIR }, #endif #if defined (ELOOP) - { "ELOOP", ELOOP, }, + { "ELOOP", ELOOP }, #endif #if defined (EMFILE) - { "EMFILE", EMFILE, }, + { "EMFILE", EMFILE }, #endif #if defined (EMLINK) - { "EMLINK", EMLINK, }, + { "EMLINK", EMLINK }, #endif #if defined (EMSGSIZE) - { "EMSGSIZE", EMSGSIZE, }, + { "EMSGSIZE", EMSGSIZE }, #endif #if defined (ENAMETOOLONG) - { "ENAMETOOLONG", ENAMETOOLONG, }, + { "ENAMETOOLONG", ENAMETOOLONG }, #endif #if defined (ENETDOWN) - { "ENETDOWN", ENETDOWN, }, + { "ENETDOWN", ENETDOWN }, #endif #if defined (ENETRESET) - { "ENETRESET", ENETRESET, }, + { "ENETRESET", ENETRESET }, #endif #if defined (ENETUNREACH) - { "ENETUNREACH", ENETUNREACH, }, + { "ENETUNREACH", ENETUNREACH }, #endif #if defined (ENFILE) - { "ENFILE", ENFILE, }, + { "ENFILE", ENFILE }, #endif #if defined (ENOBUFS) - { "ENOBUFS", ENOBUFS, }, + { "ENOBUFS", ENOBUFS }, #endif #if defined (ENODEV) - { "ENODEV", ENODEV, }, + { "ENODEV", ENODEV }, #endif #if defined (ENOENT) - { "ENOENT", ENOENT, }, + { "ENOENT", ENOENT }, #endif #if defined (ENOEXEC) - { "ENOEXEC", ENOEXEC, }, + { "ENOEXEC", ENOEXEC }, #endif #if defined (ENOLCK) - { "ENOLCK", ENOLCK, }, + { "ENOLCK", ENOLCK }, #endif #if defined (ENOMEM) - { "ENOMEM", ENOMEM, }, + { "ENOMEM", ENOMEM }, #endif #if defined (ENOPROTOOPT) - { "ENOPROTOOPT", ENOPROTOOPT, }, + { "ENOPROTOOPT", ENOPROTOOPT }, #endif #if defined (ENOSPC) - { "ENOSPC", ENOSPC, }, + { "ENOSPC", ENOSPC }, #endif #if defined (ENOSYS) - { "ENOSYS", ENOSYS, }, + { "ENOSYS", ENOSYS }, #endif #if defined (ENOTBLK) - { "ENOTBLK", ENOTBLK, }, + { "ENOTBLK", ENOTBLK }, #endif #if defined (ENOTCONN) - { "ENOTCONN", ENOTCONN, }, + { "ENOTCONN", ENOTCONN }, #endif #if defined (ENOTDIR) - { "ENOTDIR", ENOTDIR, }, + { "ENOTDIR", ENOTDIR }, #endif #if defined (ENOTEMPTY) - { "ENOTEMPTY", ENOTEMPTY, }, + { "ENOTEMPTY", ENOTEMPTY }, #endif #if defined (ENOTSOCK) - { "ENOTSOCK", ENOTSOCK, }, + { "ENOTSOCK", ENOTSOCK }, #endif #if defined (ENOTTY) - { "ENOTTY", ENOTTY, }, + { "ENOTTY", ENOTTY }, #endif #if defined (ENXIO) - { "ENXIO", ENXIO, }, + { "ENXIO", ENXIO }, #endif #if defined (EOPNOTSUPP) - { "EOPNOTSUPP", EOPNOTSUPP, }, + { "EOPNOTSUPP", EOPNOTSUPP }, #endif #if defined (EPERM) - { "EPERM", EPERM, }, + { "EPERM", EPERM }, #endif #if defined (EPFNOSUPPORT) - { "EPFNOSUPPORT", EPFNOSUPPORT, }, + { "EPFNOSUPPORT", EPFNOSUPPORT }, #endif #if defined (EPIPE) - { "EPIPE", EPIPE, }, + { "EPIPE", EPIPE }, #endif #if defined (EPROTONOSUPPORT) - { "EPROTONOSUPPORT", EPROTONOSUPPORT, }, + { "EPROTONOSUPPORT", EPROTONOSUPPORT }, #endif #if defined (EPROTOTYPE) - { "EPROTOTYPE", EPROTOTYPE, }, + { "EPROTOTYPE", EPROTOTYPE }, #endif #if defined (ERANGE) - { "ERANGE", ERANGE, }, + { "ERANGE", ERANGE }, #endif #if defined (EREMOTE) - { "EREMOTE", EREMOTE, }, + { "EREMOTE", EREMOTE }, #endif #if defined (ERESTART) - { "ERESTART", ERESTART, }, + { "ERESTART", ERESTART }, #endif #if defined (EROFS) - { "EROFS", EROFS, }, + { "EROFS", EROFS }, #endif #if defined (ESHUTDOWN) - { "ESHUTDOWN", ESHUTDOWN, }, + { "ESHUTDOWN", ESHUTDOWN }, #endif #if defined (ESOCKTNOSUPPORT) - { "ESOCKTNOSUPPORT", ESOCKTNOSUPPORT, }, + { "ESOCKTNOSUPPORT", ESOCKTNOSUPPORT }, #endif #if defined (ESPIPE) - { "ESPIPE", ESPIPE, }, + { "ESPIPE", ESPIPE }, #endif #if defined (ESRCH) - { "ESRCH", ESRCH, }, + { "ESRCH", ESRCH }, #endif #if defined (ESTALE) - { "ESTALE", ESTALE, }, + { "ESTALE", ESTALE }, #endif #if defined (ETIMEDOUT) - { "ETIMEDOUT", ETIMEDOUT, }, + { "ETIMEDOUT", ETIMEDOUT }, #endif #if defined (ETOOMANYREFS) - { "ETOOMANYREFS", ETOOMANYREFS, }, + { "ETOOMANYREFS", ETOOMANYREFS }, #endif #if defined (ETXTBSY) - { "ETXTBSY", ETXTBSY, }, + { "ETXTBSY", ETXTBSY }, #endif #if defined (EUSERS) - { "EUSERS", EUSERS, }, + { "EUSERS", EUSERS }, #endif #if defined (EWOULDBLOCK) - { "EWOULDBLOCK", EWOULDBLOCK, }, + { "EWOULDBLOCK", EWOULDBLOCK }, #endif #if defined (EXDEV) - { "EXDEV", EXDEV, }, + { "EXDEV", EXDEV }, #endif // Others (duplicates are OK). @SYSDEP_ERRNO_LIST@ - { 0, 0, }, + { nullptr, 0 }, }; // Stuff them all in a map for fast access.
--- a/libinterp/parse-tree/oct-parse.in.yy Wed Jul 26 21:09:19 2017 -0700 +++ b/libinterp/parse-tree/oct-parse.in.yy Thu Jul 27 08:32:17 2017 -0700 @@ -1897,7 +1897,7 @@ YYUSE ($4); if (! ($$ = parser.make_classdef_events_block - ($1, $3, 0, $5, $2))) + ($1, $3, nullptr, $5, $2))) { // make_classdef_events_block deleted $3. YYABORT; @@ -2796,7 +2796,7 @@ token *end_tok, comment_list *lc) { - tree_command *retval = 0; + tree_command *retval = nullptr; maybe_warn_assign_as_truth_value (expr);
--- a/liboctave/array/fCMatrix.cc Wed Jul 26 21:09:19 2017 -0700 +++ b/liboctave/array/fCMatrix.cc Thu Jul 27 08:32:17 2017 -0700 @@ -2333,7 +2333,7 @@ FloatComplexMatrix::solve (const FloatColumnVector& b, octave_idx_type& info, float& rcon) const { - return solve (FloatComplexColumnVector (b), info, rcon, 0); + return solve (FloatComplexColumnVector (b), info, rcon, nullptr); } FloatComplexColumnVector