Is this a good practice? "/*/something/*/something//*/"
/*/ comment here do some thing. /*/ do some thing. //*/ Why people write code like that? Is this a good practice? ...
/*/ comment here do some thing. /*/ do some thing. //*/ Why people write code like that? Is this a good practice? ...
Hi, I'm looking for ways to interface a slow device (an ADC - ~1.2MHz) to my mcf5270 microcontroller, which is a rather fast device (~150MHz). I am using ADC0817, and have tried the following: GPIO read off the data lines, memory mapped access (since the adc is uP compatible). When mapped as a location in memory, I am using the maximu...
I'd like to intercept the WM_DELETE_WINDOW message that is posted to a certain selection of windows that an application I'm writing (AllTray), so that I can act on it instead of the application receiving it. I'm currently looking at trying this at the GDK level via gdk_display_add_client_message_filter if possible, but I'd be happy with...
For child processes, the wait() and waitpid() functions can be used to suspends execution of the current process until a child has exited. But this function can not be used for non-child processes. Is there another function, which can wait for exit of any process ? ...
I've found following article: Use GCC-provided atomic lock operations to replace pthread_mutex_lock functions It refers to GCC Atomic Builtins. What the article suggest, is to use GCC atomic builtins instead of pthread synchronization tools. Is this a good idea? PS. The mysql post is obviously misleading. Atomic Builtins can't replac...
Is there any small library, that wrapps various processors' CAS-like operations into macros or functions, that are portable across multiple compilers? PS. The atomic.hpp library is inside boost::interprocess::detail namespace. The author refuses to make it a public, well maintained library. Lets reopen the question, and see if there ar...
I have a C application and I want to include a Scripting Language to put certain functionality into scripts. I just have no experience with that and don't know exactly where to start (Still learning C and trying to understand the application). How does embedding and communication between my app and the scripts actually work? I think I n...
I'm a C# programmer and I'm sold on the benefits of learning C. I want to deepen my knowledge of the underlying OS and CPU, understand the pain of memory management that garbage collection encapsulates away and generally improve my high-level programs thanks to an appreciation of the low-level issues that the compiler is dealing with on ...
For some reason when I return from the signal handler for SIGFPE, the variable i is one less than I expect it to be, to get the correct results from my program (iterate through all of the pairs in the pairs array) I must check the return value of sigsetjmp and increment i if I am returning from a signal "catch". Why is this? Why is the i...
After writing several different custom serial protocols for various projects, I've started to become frustrated with re-inventing the wheel every time. In lieu of continuing to develop custom solutions for every project, I've been searching for a more general solution. I was wondering if anyone knows of a serial protocol (or better ye...
Background: I'm writing a daemon that makes outgoing TCP/IP connections. It will be running on machines with multiple (non-loopback) IP addresses. I'd like the users to be able to specify, in the daemon's config file, which IP address(es) to use for outgoing connections, or * to use all. The addresses will be used in a rotation, each...
Not sure if this is possible but I want to be able to start with a string, and then figure out what the input must be into the crypt in order to get this string out. Or maybe it's impossible, which would be the whole purpose of the thing anyways? EDIT: And yes, there is a salt in the code where I am trying this. ...
I am using Visual Studio 6 with some old time code written in c. I found an issue where the code looks like this.. int x = 3; float y = 3.0; if(x == y){ do some crazy stuff } is this a valid comparison? is it possible at run time the allocation for the float is 3.0000001 and this would fail? I am a rookie so take it easy on me :...
I'm new to the software engineering side of C development; does anyone have a good guide on how to design an error tracking or error control system for a C project (especially embedded)? Something talking about error tracking for C libraries would be helpful too. ...
What methods, practices and conventions do you know of to modularize C code as a project grows in size? ...
I'm in the process of teaching myself Objective-C via Stephen Kochan's "Programing In Objective-C 2.0" It's a great book and currently reading it for the second time, first time I got the gist of it and now it's really starting to sink in the second time. If you have a moderate (about) knowledge of Objective-C, how difficult would it b...
Hello all, I am writing an application in C in GCC (for linux/ubuntu) that uses the following inline assembly: float a[4] = { 10, 20, 30, 40 }; float b[4] = { 0.1, 0.1, 0.1, 0.1 }; asm volatile("movups (%0), %%xmm0\n\t" "mulps (%1), %%xmm0\n\t" "movups %%xmm0, (%1)" :: "r" (a), "r" (b)); Excuse...
Will explain the problem that I'm faces, so that you have a better idea about the situation. We have one project, and about 6 months ago it was branched off. Lets call our branch A, and theirs branch B. In that time branch B has had 100,000 more lines of code added or deleted. We on the other hand have added or changed about 50,000 lin...
When a C function does not accept any arguments, does it have to be declared/defined with a "void" parameter by the language rules? PC-Lint seems to have problems when there's nothing at all in the argument-list, and I was wondering if it's something in the language syntax that I don't know about. Edit: I just found a duplicate (back-d...
Hi Everybody I have a C program to check whether the machine stack is growing up or down in memory in. It goes like that : #include <stdio .h> void sub(int *a) { int b; if (&b > a) { printf("Stack grows up."); } else { printf("Stack grows down."); } } main () { int a; sub(&a); } Now i want to do the same in Java. :-) An...