Jump to content

freghar

Members
  • Posts

    461
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by freghar

  1. Yes, you may know a lot of things about algorithms, pascal-like code style without breaks, fortran, etc., but, c'mon, those are oldies. Imagine a function where you want to check if certain things are met before going further and you want those checks to be easily removable / changeable without much rewriting. int handle_interface(struct skbuff *skb) { // does the sk_buff struct exist? if (!skb || !skb->len) return -1; // does it have a valid input interface? if (!skb->dev) return -1; // make a copy and sort it in an array if (!skb_make_writable(skb)) return -ENOMEM; ...... } Got the idea? It's about logic sorting of checks so you can easily debug each part and easily comment out to make tests and such stuff. Not to mention errno setting ..
  2. In fact, many compilers will do some optimizations, unless you directly prohibit that, so if you use two printf() calls one after another, they'll be most likely merged in the final code to one write(). So those two snippets will probably get compiled in the same way: if (one) { if (two) { do_stuff(); } } if (one && two) { do_stuff(); } Conditions which are always true will be mostly ignored (with a warning) if (1) { do_stuff(); } and so on .. So it's just about code style
  3. You should keep the "RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY);" thing there.
  4. That's why hashes are used instead of revision numbers. Even if the commit would be exactly the same, it will have different hash in mangos-0.12, because some of it's parents differs. So a hard reset or a checkout to specific hash (or other revspec, relative to mangos-0.12) will work. See "git checkout mangos-0.12 && git log --pretty=oneline" or visualize one branch in gitk. You can also use http://repo.or.cz/w/getmangos.git?a=shortlog;h=refs/heads/mangos-0.12 to get the hash.
  5. Perhaps even users without some kind of "this is classified developer" sign can make suggestions there. Users that know the "basic rules of thumb", like that patch with something similar to "if (spellid == 1234 || spellid == 3241)" won't probably get accepted (if other way exists) and such.
  6. unistd.h But I have some things to add: * Why the hell removed author the CR (\\r) from windows help print? I really don't know if that is going to work well on win. * About the --quiet parameter - perhaps I'm too old, but I'd still do it by closing all FDs (with a loop) or directly calling close on stdin and stderr (1,2) and then opening both on /dev/null. You don't need "nul" stream pointer this way (not to mention that I have NO idea why you're opening a FILE stream and converting it to file descriptor instead opening the file descriptor directly). * I'm curious about the daemon(3) call. Even if the support for it is in GNU/Linux, *BSD and Mac, probably excluding Solaris, I'd still use fork + setsid + close 0,1,2 and open them on /dev/null (with check if such device exists!) + chdir ..., we could tune it to use for example vfork instead of fork when available, but whatever, daemon(3) will work too. edit: Well .. to fetch something on point and get the "critic jerk" label off me, here's my old C daemonizer - http://paste2.org/p/157871 , I wrote it a while ago so no idea if it's left it in a functional state, but it should work. Maybe you can get some ideas from it.
  7. make a branch from that and add a tracking entry for it something like git branch my_243 --track remotename/remotebranch (yes, you need to add a remote first -- IIRC you can't track a FETCH_HEAD)
  8. checkout is enough
  9. Just to add - you CAN download only mangos-0.12 -- see <refspec> for git-fetch. It will download HEAD of mangos-0.12 and all commits "below", thus excluding the master branch. Something like mkdir blah cd blah git init git fetch -n git://github.com/mangos/mangos.git mangos-0.12
  10. I've seen a direct command for it about .. 17 times on this forum, perhaps more. Try looking at the SCM section.
  11. I believe it searches down the parents, ie. if you run this from a master HEAD, it never gets to mangos-0.12 .. at least I would guess. edit: ah, I see, you were right ..
  12. revspec can be for example a search command: git reset --hard [1234] should work too (it will search each commit's message for a matching string and use the first that matches). (many people probably know the slash '/' as a classic search in many text editors .. and '?' sign for backwards search (I'm not sure if that's implemented here)).
  13. freghar

    learning C++

    http://www.google.com/search?hl=en&q=C%2B%2B+tutorial
  14. +1 for that. I'm not really some large-scale programmer, so I don't use any ide or a graphical editor, ctags for VIm works fine but if I'd want to use it with remote server, I'd go for sshfs
  15. A v0.13-dev2 tag added, it points to the last commit for 3.0.8a: $ git tag -ln v0.12 MaNGOS 0.12 v0.13-dev1 MaNGOS 0.13 dev1 -- moving from client 3.0.3 v0.13-dev2 MaNGOS 0.13 dev2 -- moving from client 3.0.8a
  16. As far as I know, it does.
  17. virtual memory exhausted: Cannot allocate memory
  18. Are you sure? I remember a situation some time ago when I was playing a male character and had female sounds ... some debug command solved it at that time.
  19. This guy is almost right. Yes, it's most likely the CRLF thing if the diff looks like "deleting everything and adding it again". Check your msysgit version and autocrlf=true option in msysgit global conf (seatch for "gitconfig" file in program files\\msysgit). But this should work by default. The problem arises if you have a tree already checked out and git thinks it's clear. Deleting the whole working tree (= everything except .git) and restoring it from the object database (= hard reset for example) should work. Such problem can pop up when you apply a patch which adds code with LF endings instead of CRLF (on win) with autocrlf=true in config. Try git diff --check on that range as well.
  20. Marketing reasons behind everything. Microsoft eventually fears that young developers get used to open source (or other non-MS) tools, so it acts like this
  21. If you want mangos as a _real_ daemon, nothing stands between you and such goal. Use a simple C program for example - close all I/O FDs, reopen 0,1,2 (stdin,out,err) on /dev/null, fork() under init, change process group ID, load mangos-worldd into own memory space and execute it (using exec() / execv() / execve() / ...). It's that simple. Python has that on ~6 lines.
  22. git log --pretty=oneline <range> git log <range> | git shortlog or use git-shortlog directly (offtopic: see?!? that's where the commit headers come in use, so please don't ignore them)
  23. Furthermore, /bin/sh is a generic shell, available on _all_ *nix-like systems. It's rarely a symlink to some other shell. So yes, this script will probably work on *BSD, Solaris, etc., since I can't find any bash specifics.
  24. Branch 308 has been merged into master, so yes, it has both fixes from master and changes from 308. I've made a "v0.13-dev1" tag on the last commit for 303 client (no, current master doesn't support 303 anymore). $ git tag -ln v0.12 MaNGOS 0.12 v0.13-dev1 MaNGOS 0.13 dev1 -- moving from client 3.0.3
  25. There's a lot more, like porting the GM away when the BG ends, unable to .tele inside a BG/arena map, etc. I wanted to do such checks myself, but then I realized that instance system is far away from me and leaving GM hanging in some instance as an exception could lead to crashes.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use