DEADSOFTWARE

update copyrights
[flatwaifu.git] / src / memory.c
index 5be719f55d45d1741146a21e3341a5a1d97be3b1..4abb35a167304b672ea36876c0929b28dcd262f4 100644 (file)
@@ -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 <http://www.gnu.org/licenses/> 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 <http://www.gnu.org/licenses/>.
+ */
 
 #include "glob.h"
 #include <stdio.h>
@@ -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);
 }