--- rpl/src/instructions_l4.c 2010/01/26 15:22:44 1.1.1.1 +++ rpl/src/instructions_l4.c 2018/12/24 15:55:50 1.63 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.0.9 - Copyright (C) 1989-2010 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.30 + Copyright (C) 1989-2018 Dr. BERTRAND Joël This file is part of RPL/2. @@ -20,7 +20,7 @@ */ -#include "rpl.conv.h" +#include "rpl-conv.h" /* @@ -46,8 +46,8 @@ instruction_lu(struct_processus *s_etat_ struct_objet *s_objet_resultat_2; struct_objet *s_objet_resultat_3; - unsigned long i; - unsigned long j; + integer8 i; + integer8 j; (*s_etat_processus).erreur_execution = d_ex; @@ -183,8 +183,8 @@ instruction_lu(struct_processus *s_etat_ .nombre_colonnes; if (((*((struct_matrice *) (*s_objet_resultat_3).objet)).tableau = - malloc((*((struct_matrice *) (*s_objet_resultat_3) - .objet)).nombre_lignes * sizeof(real8 *))) == NULL) + malloc(((size_t) (*((struct_matrice *) (*s_objet_resultat_3) + .objet)).nombre_lignes) * sizeof(real8 *))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -194,8 +194,8 @@ instruction_lu(struct_processus *s_etat_ .nombre_lignes; i++) { if ((((real8 **) (*((struct_matrice *) (*s_objet_resultat_3).objet)) - .tableau)[i] = malloc((*((struct_matrice *) - (*s_objet_resultat_3).objet)).nombre_colonnes * + .tableau)[i] = malloc(((size_t) (*((struct_matrice *) + (*s_objet_resultat_3).objet)).nombre_colonnes) * sizeof(real8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -240,8 +240,8 @@ instruction_lu(struct_processus *s_etat_ .nombre_colonnes; if (((*((struct_matrice *) (*s_objet_resultat_2).objet)).tableau = - malloc((*((struct_matrice *) (*s_objet_resultat_2) - .objet)).nombre_lignes * sizeof(real8 *))) == NULL) + malloc(((size_t) (*((struct_matrice *) (*s_objet_resultat_2) + .objet)).nombre_lignes) * sizeof(real8 *))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -251,8 +251,8 @@ instruction_lu(struct_processus *s_etat_ .nombre_lignes; i++) { if ((((real8 **) (*((struct_matrice *) (*s_objet_resultat_2).objet)) - .tableau)[i] = malloc((*((struct_matrice *) - (*s_objet_resultat_2).objet)).nombre_colonnes * + .tableau)[i] = malloc(((size_t) (*((struct_matrice *) + (*s_objet_resultat_2).objet)).nombre_colonnes) * sizeof(real8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -367,8 +367,8 @@ instruction_lu(struct_processus *s_etat_ .nombre_colonnes; if (((*((struct_matrice *) (*s_objet_resultat_3).objet)).tableau = - malloc((*((struct_matrice *) (*s_objet_resultat_3) - .objet)).nombre_lignes * sizeof(complex16 *))) == NULL) + malloc(((size_t) (*((struct_matrice *) (*s_objet_resultat_3) + .objet)).nombre_lignes) * sizeof(complex16 *))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -379,8 +379,8 @@ instruction_lu(struct_processus *s_etat_ { if ((((complex16 **) (*((struct_matrice *) (*s_objet_resultat_3).objet)) - .tableau)[i] = malloc((*((struct_matrice *) - (*s_objet_resultat_3).objet)).nombre_colonnes * + .tableau)[i] = malloc(((size_t) (*((struct_matrice *) + (*s_objet_resultat_3).objet)).nombre_colonnes) * sizeof(complex16))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -429,8 +429,8 @@ instruction_lu(struct_processus *s_etat_ .nombre_colonnes; if (((*((struct_matrice *) (*s_objet_resultat_2).objet)).tableau = - malloc((*((struct_matrice *) (*s_objet_resultat_2) - .objet)).nombre_lignes * sizeof(complex16 *))) == NULL) + malloc(((size_t) (*((struct_matrice *) (*s_objet_resultat_2) + .objet)).nombre_lignes) * sizeof(complex16 *))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -441,8 +441,8 @@ instruction_lu(struct_processus *s_etat_ { if ((((complex16 **) (*((struct_matrice *) (*s_objet_resultat_2).objet)) - .tableau)[i] = malloc((*((struct_matrice *) - (*s_objet_resultat_2).objet)).nombre_colonnes * + .tableau)[i] = malloc(((size_t) (*((struct_matrice *) + (*s_objet_resultat_2).objet)).nombre_colonnes) * sizeof(complex16))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -716,6 +716,8 @@ instruction_lock(struct_processus *s_eta struct flock lock; + struct_descripteur_fichier *fichier; + struct_objet *s_objet_argument_1; struct_objet *s_objet_argument_2; @@ -779,7 +781,7 @@ instruction_lock(struct_processus *s_eta lock.l_len = 0; lock.l_pid = getpid(); - if ((chaine = conversion_majuscule((unsigned char *) + if ((chaine = conversion_majuscule(s_etat_processus, (unsigned char *) (*s_objet_argument_1).objet)) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -811,12 +813,14 @@ instruction_lock(struct_processus *s_eta free(chaine); - if ((descripteur = descripteur_fichier(s_etat_processus, + if ((fichier = descripteur_fichier(s_etat_processus, (struct_fichier *) (*s_objet_argument_2).objet)) == NULL) { return; } + descripteur = (*fichier).descripteur_c; + if (fcntl(fileno(descripteur), F_SETLK, &lock) == -1) { liberation(s_etat_processus, s_objet_argument_1);