Changeset a000878c in mainline for uspace/srv/loader


Ignore:
Timestamp:
2010-02-25T19:11:25Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
958de16
Parents:
a634485
Message:

make sure that all statically allocated strings are declared as "const char *"
and are treated as read-only

Location:
uspace/srv/loader
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/loader/elf_load.c

    ra634485 ra000878c  
    6060#define DPRINTF(...)
    6161
    62 static char *error_codes[] = {
     62static const char *error_codes[] = {
    6363        "no error",
    6464        "invalid image",
     
    9595 * pointed to by @a info.
    9696 *
    97  * @param file_name     Path to the ELF file.
    98  * @param so_bias       Bias to use if the file is a shared object.
    99  * @param info          Pointer to a structure for storing information
    100  *                      extracted from the binary.
     97 * @param file_name Path to the ELF file.
     98 * @param so_bias   Bias to use if the file is a shared object.
     99 * @param info      Pointer to a structure for storing information
     100 *                  extracted from the binary.
    101101 *
    102102 * @return EOK on success or negative error code.
    103  */
    104 int elf_load_file(char *file_name, size_t so_bias, elf_info_t *info)
     103 *
     104 */
     105int elf_load_file(const char *file_name, size_t so_bias, elf_info_t *info)
    105106{
    106107        elf_ld_t elf;
     
    130131 * earlier with elf_load_file(). This function does not return.
    131132 *
    132  * @param info  Info structure filled earlier by elf_load_file()
     133 * @param info Info structure filled earlier by elf_load_file()
     134 *
    133135 */
    134136void elf_run(elf_info_t *info, pcb_t *pcb)
     
    280282 * @return NULL terminated description of error.
    281283 */
    282 char *elf_error(unsigned int rc)
     284const char *elf_error(unsigned int rc)
    283285{
    284286        assert(rc < sizeof(error_codes) / sizeof(char *));
  • uspace/srv/loader/include/elf.h

    ra634485 ra000878c  
    337337#endif
    338338
    339 extern char *elf_error(unsigned int rc);
     339extern const char *elf_error(unsigned int rc);
    340340
    341341#endif
  • uspace/srv/loader/include/elf_load.h

    ra634485 ra000878c  
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
     
    5151
    5252        /** ELF interpreter name or NULL if statically-linked */
    53         char *interp;
     53        const char *interp;
    5454
    5555        /** Pointer to the dynamic section */
     
    7474} elf_ld_t;
    7575
    76 int elf_load_file(char *file_name, size_t so_bias, elf_info_t *info);
     76int elf_load_file(const char *file_name, size_t so_bias, elf_info_t *info);
    7777void elf_run(elf_info_t *info, pcb_t *pcb);
    7878void elf_create_pcb(elf_info_t *info, pcb_t *pcb);
Note: See TracChangeset for help on using the changeset viewer.