| /netbsd-src/tests/usr.bin/xlint/lint1/ |
| H A D | queries.c | 5 * Demonstrate the case-by-case queries. Unlike warnings, queries do not 7 * inspect manually on a case-by-case basis. 18 /* lint1-extra-flags: -q 1,2,3,4,5,6,7,8,9,10 */ 19 /* lint1-extra-flags: - [all...] |
| H A D | msg_324.c | 4 // Test for message: suggest cast from '%s' to '%s' on op '%s' to avoid overflow [324] 17 /* lint1-flags: -g -S -w -P -X 351 */ 25 /* expect+2: warning: suggest cast from 'int' to 'long long' on op '+' to avoid overflow [324] */ in example() 28 /* expect+1: warning: suggest cast from 'int' to 'long long' on op '-' to avoid overflow [324] */ in example() 29 ll = i - c; in example() 30 …/* expect+2: warning: suggest cast from 'unsigned int' to 'unsigned long long' on op '*' to avoid … in example() 33 …/* expect+1: warning: suggest cast from 'unsigned int' to 'unsigned long long' on op '+' to avoid … in example() 35 …/* expect+1: warning: suggest cast from 'unsigned int' to 'unsigned long long' on op '-' to avoid … in example() 36 ull = i - u; in example() 37 …/* expect+1: warning: suggest cast from 'unsigned int' to 'unsigned long long' on op '*' to avoid … in example() [all …]
|
| /netbsd-src/external/gpl3/gcc/dist/libphobos/libdruntime/core/sys/posix/sys/ |
| H A D | ioccom.d | 25 /* OSX ioctl's (based on FreeBSD) encode the command in the lower 16-bits in version() 27 * 16-bits of a 32 bit unsigned integer. The high 3 bits of the upper in version() 28 * 16-bits encode the in/out status of the parameter. in version() 46 enum uint IOC_VOID = 0x20000000; // no parameters in version() 58 // encode a command with no parameters in version() 61 return _IOC(IOC_VOID, cast(uint)g, cast(uint)n, cast(size_t)0); in version() 66 return _IOC!(T)(IOC_OUT, cast(uint)g, cast(uint)n, T.sizeof); in version() 71 return _IOC!(T)(IOC_IN, cast(uint)g, cast(uint)n, T.sizeof); in version() 76 return _IOC!(T)(IOC_INOUT, cast(uint)g, cast(uint)n, T.sizeof); in version() 81 /* FreeBSD ioctl's encode the command in the lower 16-bits in version() [all …]
|
| /netbsd-src/external/apache2/llvm/dist/clang/lib/StaticAnalyzer/Checkers/ |
| H A D | ConversionChecker.cpp | 1 //=== ConversionChecker.cpp -------------------------------------*- C++ -*-===// 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 //===----------------------------------------------------------------------===// 9 // Check that there is no loss of sign/precision in assignments, comparisons 25 //===----------------------------------------------------------------------===// 42 void checkPreStmt(const ImplicitCastExpr *Cast, CheckerContext &C) const; 47 bool isLossOfPrecision(const ImplicitCastExpr *Cast, QualType DestType, 50 bool isLossOfSign(const ImplicitCastExpr *Cast, CheckerContext &C) const; 56 void ConversionChecker::checkPreStmt(const ImplicitCastExpr *Cast, in checkPreStmt() argument 60 if (!isa<DeclRefExpr>(Cast->IgnoreParenImpCasts())) in checkPreStmt() [all …]
|
| /netbsd-src/external/gpl3/gcc/dist/libphobos/src/std/experimental/allocator/building_blocks/ |
| H A D | region.d | 9 import std.typecons : Flag, Yes, No; 22 There is no deallocation, and once the region is full, allocation requests 24 more sophisticated allocators; or (b) for batch-style very fast allocations 43 Flag!"growDownwards" growDownwards = No.growDownwards) 70 return cast(void*) roundUpToAlignment(cast(size_t) _begin, alignment); in roundedBegin() 75 return cast(void*) roundDownToAlignment(cast(size_t) _end, alignment); in roundedEnd() 78 Constructs a region backed by a user-provided store. 83 store = User-provided store backing up the region. If $(D 105 this(cast(ubyte[]) (parent.allocate(n.roundUpToAlignment(alignment)))); in this() 113 this(cast(ubyte[]) (parent.allocate(n.roundUpToAlignment(alignment)))); in this() [all …]
|
| H A D | bitmapped_block.d | 9 import std.typecons : Flag, Yes, No; 12 // Common implementation for shared and non-shared versions of the BitmappedBlock 40 assert((cast(BitVector) _control).length == 0 && s % alignment == 0); in BitmappedBlockImpl() 105 : alignment - initialAlignment; in BitmappedBlockImpl() 122 for (localBlocks = _blocks; localBlocks; --localBlocks) in BitmappedBlockImpl() 136 … _control = cast(typeof(_control)) BitVector((cast(ulong*) data.ptr)[0 .. controlWords]); in BitmappedBlockImpl() 137 (cast(BitVector) _control)[] = 0; in BitmappedBlockImpl() 141 _control = (cast(typeof(_control.ptr)) data.ptr)[0 .. controlWords]; in BitmappedBlockImpl() 145 _payload = cast(typeof(_payload)) payload; in BitmappedBlockImpl() 149 _blocks = cast(typeof(_blocks)) localBlocks; in BitmappedBlockImpl() [all …]
|
| /netbsd-src/external/gpl3/gcc.old/dist/libphobos/src/std/experimental/allocator/building_blocks/ |
| H A D | region.d | 6 import std.typecons : Flag, Yes, No; 10 There is no deallocation, and once the region is full, allocation requests 12 more sophisticated allocators; or (b) for batch-style very fast allocations 31 Flag!"growDownwards" growDownwards = No.growDownwards) 56 Constructs a region backed by a user-provided store. Assumes $(D store) is 61 store = User-provided store backing up the region. $(D store) must be 72 store = cast(ubyte[])(store.roundUpToAlignment(alignment)); in this() 88 this(cast(ubyte[])(parent.allocate(n.roundUpToAlignment(alignment)))); in this() 104 parent.deallocate(_begin[0 .. _end - _begin]); in ~this() 121 A properly-aligned buffer of size $(D n) or $(D null) if request could not [all …]
|
| /netbsd-src/external/gpl3/gcc/dist/gcc/d/dmd/ |
| H A D | staticcond.d | 4 * Copyright: Copyright (C) 1999-2022 by The D Language Foundation, All Rights Reserved 53 NotExp ne = cast(NotExp)e; in impl() 59 LogicalExp aae = cast(LogicalExp)e; in impl() 79 CondExp ce = cast(CondExp)e; in impl() 127 * Format a static condition as a tree-like structure, marking failed and 158 // tree-like structure; traverse and format simultaneously in visualizeFull() 176 // !(A && B) -> !A || !B in visualizeFull() 177 // !(A || B) -> !A && !B in visualizeFull() 188 NotExp no = cast(NotExp)orig; in visualizeFull() local 189 NotExp ne = cast(NotExp)e; in visualizeFull() [all …]
|
| H A D | sideeffect.d | 2 * Find side-effects of expressions. 4 * Copyright: Copyright (C) 1999-2022 by The D Language Foundation, All Rights Reserved 29 * Front-end expression rewriting should create temporary variables for 30 * non trivial sub-expressions in order to: 32 * 2. prevent sharing of sub-expression in AST 109 TypeFunction tf = cast(TypeFunction)f.type; in callSideEffectLevel() 129 tf = cast(TypeFunction)(cast(TypeDelegate)t).next; in callSideEffectLevel() 133 tf = cast(TypeFunction)t; in callSideEffectLevel() 197 CallExp ce = cast(CallExp)e; 199 * has no side effects. [all …]
|
| /netbsd-src/external/gpl3/gcc.old/dist/libphobos/libdruntime/gcc/ |
| H A D | deh.d | 2 // Copyright (C) 2011-2020 Free Software Foundation, Inc. 46 * D exceptions -- "GNUCD\0\0\0". 47 * C++ exceptions -- "GNUCC++\0" 48 * C++ dependent exceptions -- "GNUCC++\x01" 59 (cast(_Unwind_Exception_Class)'G' << 56) | 60 (cast(_Unwind_Exception_Class)'N' << 48) | 61 (cast(_Unwind_Exception_Class)'U' << 40) | 62 (cast(_Unwind_Exception_Class)'C' << 32) | 63 (cast(_Unwind_Exception_Class)'D' << 24); 66 (cast(_Unwind_Exception_Class)'G' << 56) | [all …]
|
| H A D | backtrace.d | 2 // Copyright (C) 2013-2020 Free Software Foundation, Inc. 39 // whether the exception is user or system-generated, so 55 auto context = cast(LibBacktrace)data; in simpleCallback() 71 auto context = cast(LibBacktrace)data; in simpleErrorCallback() 72 strncpy(context.errorBuf.ptr, msg, context.errorBuf.length - 1); in simpleErrorCallback() 83 auto context = cast(SymbolCallbackInfo*)data; in pcinfoCallback() 98 auto sym = SymbolOrError(0, SymbolInfo(func, filename, lineno, cast(void*)pc)); in pcinfoCallback() 110 auto context = cast(SymbolCallbackInfo*)data; in pcinfoErrorCallback() 112 if (errnum == -1) in pcinfoErrorCallback() 132 auto context = cast(SymbolCallbackInfo*)data; in syminfoCallback() [all …]
|
| /netbsd-src/external/gpl3/gcc/dist/libphobos/libdruntime/gcc/ |
| H A D | deh.d | 2 // Copyright (C) 2011-2022 Free Software Foundation, Inc. 42 * D exceptions -- "GNUCD\0\0\0". 43 * C++ exceptions -- "GNUCC++\0" 44 * C++ dependent exceptions -- "GNUCC++\x01" 55 (cast(_Unwind_Exception_Class)'G' << 56) | 56 (cast(_Unwind_Exception_Class)'N' << 48) | 57 (cast(_Unwind_Exception_Class)'U' << 40) | 58 (cast(_Unwind_Exception_Class)'C' << 32) | 59 (cast(_Unwind_Exception_Class)'D' << 24); 62 (cast(_Unwind_Exception_Class)'G' << 56) | [all …]
|
| H A D | backtrace.d | 2 // Copyright (C) 2013-2022 Free Software Foundation, Inc. 37 auto context = cast(LibBacktrace)data; in simpleCallback() 53 auto context = cast(LibBacktrace)data; in simpleErrorCallback() 54 strncpy(context.errorBuf.ptr, msg, context.errorBuf.length - 1); in simpleErrorCallback() 65 auto context = cast(SymbolCallbackInfo*)data; in pcinfoCallback() 80 auto sym = SymbolOrError(0, SymbolInfo(func, filename, lineno, cast(void*)pc)); in pcinfoCallback() 92 auto context = cast(SymbolCallbackInfo*)data; in pcinfoErrorCallback() 94 if (errnum == -1) in pcinfoErrorCallback() 114 auto context = cast(SymbolCallbackInfo*)data; in syminfoCallback() 116 auto sym = SymbolOrError(0, SymbolInfo(symname, null, 0, cast(void*)pc)); in syminfoCallback() [all …]
|
| /netbsd-src/external/gpl3/gcc.old/dist/libphobos/libdruntime/rt/ |
| H A D | lifetime.d | 5 * Copyright: Copyright Digital Mars 2000 - 2012. 37 BIGLENGTHMASK = ~(PAGESIZE - 1), 42 MAXSMALLSIZE = 256-SMALLPAD, 43 MAXMEDSIZE = (PAGESIZE / 2) - MEDPAD 55 cast() callStructDtorsDuringGC = s[0] == '1' || s[0] == 'y' || s[0] == 'Y'; 57 cast() callStructDtorsDuringGC = true; 75 debug(PRINTF) printf("_d_newclass(ci = %p, %s)\n", ci, cast(char *)ci.name); 103 …printf("ci = %p, ci.init.ptr = %p, len = %llu\n", ci, ci.initializer.ptr, cast(ulong)ci.initialize… 104 printf("vptr = %p\n", *cast(void**) ci.initializer); 105 printf("vtbl[0] = %p\n", (*cast(void***) ci.initializer)[0]); [all …]
|
| /netbsd-src/external/gpl3/gcc/dist/libphobos/libdruntime/core/ |
| H A D | memory.d | 8 * useful when doing low-level _memory management. 13 $(LI The GC is a conservative mark-and-sweep collector. It only runs a 16 there will be no GC collection pauses. The pauses occur because 52 * word-interpreted representation of the variable matches a GC-managed 55 * $(LI Implementations are free to scan the non-root heap in a precise 72 * so long as no valid GC pointers are invalidated in the process. 77 * only reference to a GC-managed _memory block points into the 86 * pointer values and GC-managed _memory blocks, so long as such a 88 * that only a stop-the-world collector can do this.) 99 * Copyright: Copyright Sean Kelly 2005 - 2015. [all …]
|
| /netbsd-src/external/gpl3/gcc/dist/libphobos/src/std/math/ |
| H A D | trigonometry.d | 8 Copyright: Copyright The D Language Foundation 2000 - 2011. 82 assert(cos(3.0).isClose(-0.9899924966)); 95 float f = cos(-2.0f); 96 assert(fabs(f - -0.416147f) < .00001); 98 double d = cos(-2.0); 99 assert(fabs(d - -0.416147f) < .00001); 101 real r = cos(-2.0L); 102 assert(fabs(r - -0.416147f) < .00001); 111 * $(TD3 $(PLUSMN)0.0, $(PLUSMN)0.0, no ) 157 float f = sin(-2.0f); [all …]
|
| /netbsd-src/external/gpl3/gcc/dist/libphobos/libdruntime/rt/ |
| H A D | lifetime.d | 5 * Copyright: Copyright Digital Mars 2000 - 2012. 33 BIGLENGTHMASK = ~(PAGESIZE - 1), 38 MAXSMALLSIZE = 256-SMALLPAD, 39 MAXMEDSIZE = (PAGESIZE / 2) - MEDPAD 66 debug(PRINTF) printf("_d_newclass(ci = %p, %s)\n", ci, cast(char *)ci.name); 94 printf("ci = %p, ci.init.ptr = %p, len = %llu\n", ci, init.ptr, cast(ulong)init.length); 95 printf("vptr = %p\n", *cast(void**) init); 96 printf("vtbl[0] = %p\n", (*cast(void***) init)[0]); 97 printf("vtbl[1] = %p\n", (*cast(void***) init)[1]); 98 printf("init[0] = %x\n", (cast(uint*) init)[0]); [all …]
|
| H A D | dmain2.d | 4 * Copyright: Copyright Digital Mars 2000 - 2018. 87 /* To get out-of-band access to the args[] passed to main(). 110 * If a C program wishes to call D code, and there's no D main(), then it 135 // TODO: fixme - calls GC.addRange -> Initializes GC in rt_init() 158 if (atomicOp!"-="(_initCount, 1)) return 1; in rt_term() 190 * Overrides the default trace hander with a user-supplied version. 210 * user-supplied trace handler will be called if one has been supplied, 211 * otherwise no trace will be generated. 219 * An object describing the current calling context or null if no handler is 230 * Provide out-of-band access to the original C argc/argv [all …]
|
| H A D | monitor_.d | 4 * Copyright: Copyright Digital Mars 2000 - 2015. 14 // supplied by the user. The assumption is that any object with a user- 27 auto m = ensureMonitor(cast(Object) owner); 30 atomicOp!("+=")(m.refs, cast(size_t) 1); 47 else if (!atomicOp!("-=")(m.refs, cast(size_t) 1)) in _d_monitordelete() 49 // refcount == 0 means unshared => no synchronization required in _d_monitordelete() 50 disposeEvent(cast(Monitor*) m, h); in _d_monitordelete() 51 deleteMonitor(cast(Monitor*) m); in _d_monitordelete() 68 else if (!atomicOp!("-=")(m.refs, cast(size_t) 1)) in _d_monitordelete_nogc() 70 // refcount == 0 means unshared => no synchronization required in _d_monitordelete_nogc() [all …]
|
| /netbsd-src/external/gpl3/gcc/dist/libphobos/src/std/ |
| H A D | utf.d | 4 Encode and decode UTF-8, UTF-16 and UTF-32 strings. 55 $(LINK http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8)<br> 57 Copyright: Copyright The D Language Foundation 2000 - 2012. 71 import std.typecons : Flag, Yes, No; 124 * it is const-compatible. 127 auto e = () @trusted { return cast(Exception) super; } (); 146 result ~= " - "; 160 assertThrown!UTFException(encode(buf, cast(dchar) 0xD800)); 161 assertThrown!UTFException(encode(buf, cast(dchar) 0xDBFF)); 162 assertThrown!UTFException(encode(buf, cast(dchar) 0xDC00)); [all …]
|
| /netbsd-src/external/gpl3/gcc.old/dist/libphobos/libdruntime/gcc/sections/ |
| H A D | win64.d | 1 // Win64-specific support for sections. 2 // Copyright (C) 2019-2020 Free Software Foundation, Inc. 57 auto pbeg = cast(immutable(FuncTable)*)&_deh_beg; in version() 58 auto pend = cast(immutable(FuncTable)*)&_deh_end; in version() 59 return pbeg[0 .. pend - pbeg]; in version() 81 cast(ulong)dataSection.length); in initSections() 88 _sections._gcRanges = (cast(void[]*) malloc((void[]).sizeof))[0..1]; in initSections() 93 size_t count = &_DP_end - &_DP_beg; in initSections() 94 auto ranges = cast(void[]*) malloc(count * (void[]).sizeof); in initSections() 101 continue; // assumes there is no D-pointer at the very beginning of .data in initSections() [all …]
|
| /netbsd-src/external/gpl3/gcc/dist/libphobos/testsuite/libphobos.hash/ |
| H A D | test_hash.d | 1 // { dg-prune-output "Warning: struct HasNonConstToHash has method toHash" } 2 // { dg-prune-output "HasNonConstToHash.toHash defined here:" } 143 /// test that hashOf doesn't crash for non-null C++ objects. 151 /// Ensure hashOf works for const struct that has non-const toHash & has all 152 /// fields bitwise-hashable. (Support might be removed in the future!) 189 if (fd != -1) puts("impure"); in issue19568() 192 int fd = -1; in issue19568() 228 /// Check core.internal.hash.hashOf works with enums of non-scalar values 245 cast(void) hashOf(V.init); in issue21642() 303 cast(void) hashOf(S0.init); in issue22076() [all …]
|
| /netbsd-src/external/gpl3/gcc.old/dist/libphobos/src/std/ |
| H A D | utf.d | 4 Encode and decode UTF-8, UTF-16 and UTF-32 strings. 53 $(LINK http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8)<br> 55 Copyright: Copyright Digital Mars 2000 - 2012. 66 import std.typecons; // Flag, Yes, No 112 * it is const-compatible. in toString() 115 auto e = () @trusted { return cast(Exception) super; } (); in toString() 134 result ~= " - "; in toString() 172 cast(char)(0xF0 | (y >> 18)), 173 cast(char)(0x80 | ((y >> 12) & 0x3F)), 174 cast(char)(0x80 | ((y >> 6) & 0x3F)), [all …]
|
| /netbsd-src/external/apache2/llvm/dist/clang/docs/analyzer/developer-docs/ |
| H A D | nullability.rst | 7 RFC: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2015-March/041798.html. 13 If a pointer ``p`` has a nullable annotation and no explicit null check or assert, we should warn i… 20 Explicit cast from nullable to nonnul: 22 .. code-block:: cpp 29 …cast only suppress the first call but not the second. For this reason in the first implementation … 35 …en there is an explicit cast from nonnull to nullable I will trust the cast (it is probable there … 38 .. code-block:: cpp 44 …return nil; // Should the analyzer cover this piece of code? Should we require the cast (__nonnull… 71 -------- 75 .. code-block:: cpp [all …]
|
| /netbsd-src/external/bsd/file/dist/src/ |
| H A D | readelf.c | 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 61 #define ELF_ALIGN(a) ((((a) + align - 1) / align) * align) 69 #define SIZE_UNKNOWN CAST(off_t, -1) 74 if (ms->flags & MAGIC_MIME) in toomany() 76 if (file_printf(ms, ", too many %s (%u)", name, num) == -1) in toomany() 77 return -1; in toomany() 151 ? CAST(void *, &sh32) \ 152 : CAST(void *, &sh64)) 156 #define xsh_size CAST(size_t, (clazz == ELFCLASS32 \ 159 #define xsh_offset CAST(off_t, (clazz == ELFCLASS32 \ [all …]
|