X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fmemory.c;h=4abb35a167304b672ea36876c0929b28dcd262f4;hb=c0bb00824a48b78aee7140e3fa89ac69d59d7296;hp=5be719f55d45d1741146a21e3341a5a1d97be3b1;hpb=2bb81ea2565c3627c954b5c37326db89b0048472;p=flatwaifu.git diff --git a/src/memory.c b/src/memory.c index 5be719f..4abb35a 100644 --- a/src/memory.c +++ b/src/memory.c @@ -1,23 +1,19 @@ -/* - Copyright (C) Prikol Software 1996-1997 - Copyright (C) Aleksey Volynskov 1996-1997 - - This file is part of the Doom2D:Rembo project. - - Doom2D:Rembo is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation. - - Doom2D:Rembo is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see or - write to the Free Software Foundation, Inc., - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ +/* Copyright (C) 1996-1997 Aleksey Volynskov + * Copyright (C) 2011 Rambo + * Copyright (C) 2020 SovietPony + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License ONLY. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "glob.h" #include @@ -66,7 +62,6 @@ static void allocres (int h) { void *M_lock (int h) { if(h==-1 || h==0xFFFF) return NULL; - h&=-1-0x8000; if(h>=MAX_WAD) ERR_fatal("M_lock: странный номер ресурса"); if(!resl[h]) if(!resp[h]) allocres(h); ++resl[h]; @@ -84,9 +79,9 @@ void M_unlock (void *p) { } int M_locked (int h) { - return (h != -1) && (h != 0xFFFF) && (resl[h & (-1 - 0x8000)] != 0); + return (h != -1) && (h != 0xFFFF) && (resl[h] != 0); } int M_was_locked (int h) { - return (h != -1) && (h != 0xFFFF) && (resp[h & (-1 - 0x8000)] != NULL); + return (h != -1) && (h != 0xFFFF) && (resp[h] != NULL); }